extranet/www/js/scripts2.js
2009-05-29 12:07:20 +00:00

34 lines
1.2 KiB
JavaScript

$(document).ready(function(){
//Autocomplete sur le champs NAF
$("#formR-naf").autocomplete("./pages/nafajax.php", {
minChars:3,
width: 400,
highlight: false,
scroll: true,
formatResult: function(data, value) {
return value.split(" , ")[0];
}
});
//Chargement du menu Accordion
$(function() {
$("#Menu").accordion({autoHeight: false, collapsible: true, active: 0});
});
//Auto Scroll
//var menuYloc = null;
var menuYloc = parseInt($("#floatMenu").css("top").substring(0,$("#floatMenu").css("top").indexOf("px")));
$(window).scroll(function() {
offset = menuYloc+$(document).scrollTop()+"px";
$("#floatMenu").animate({top:offset},{duration:250,queue:false});
});
var reference = parseInt($("#MainPage").css("left").substring(0,$("#MainPage").css("left").indexOf("px")));
$(window).resize(function(){
offset = parseInt($("#MainPage").css("left").substring(0,$("#MainPage").css("left").indexOf("px")))-reference;
offset = parseInt($("#floatMenu").css("left").substring(0,$("#floatMenu").css("left").indexOf("px")))+offset+"px";
$("#floatMenu").animate({left:offset},{duration:250,queue:false});
});
});