Slide menu lags
Slide menu lags
Hi All
Maybe you can help with this problem i have:
On this site:
http://www.futura-helsekost.dk/kosttilskud
i have build a produkt slide menu with images and using jquery to do some animations.
The problems is I dont know how to make it run smoothly, I have tried with the .stop().hover() but with no luck
Here is my code:
-
var tbx = document.getElementById('textbox');
var pslider = document.getElementById('pslider');
var tt;
$(document).ready(function(){
$(".menu_k li a img").stop(true, true).hover(function(){
$("#pslider").show();
tbx.innerHTML = this.getAttribute('txt');
try{
if (IE == false) {
$("#pslider").animate({ width: 40 }, 1);
var wi = (this.offsetWidth / 2) - 40;
$("#pslider").animate({ left: this.offsetLeft + wi + 20 }, 400);
}else{
$("#pslider").animate({ width: 40 }, 1);
var wi = (this.offsetWidth / 2) - 40;
$("#pslider").animate({ left: this.offsetLeft + wi + 20 }, 400);
}
tbx.style.left = '-' + (tbx.offsetWidth - 40) / 2+"px";
},
function(){
$("#pslider").hide();
});
});
Thanks
Dennis