开发者

JQuery animation in IE

I have such code:

$('div.new_menu').h开发者_开发技巧over(function(){ 
      $(this).stop(false, true).animate({width: $(this).width() + 25}, 450); 
   },function(){ 
      $(this).stop(false, true).animate({width: $(this).width() - 25}, 450); 
   });

It works perfect in all browsers except IE. Could you help me with rewriting it to JavaScript?


Try giving the first parameter to stop() as true. Also change the width as relative

Animated properties can also be relative. If a value is supplied with a leading += or -= sequence of characters, then the target value is computed by adding or subtracting the given number from the current value of the property.

$('div.new_menu').hover(function(){ 
      $(this).stop(true, true).animate({width: '+=25'}, 450); 
   },function(){ 
      $(this).stop(true, true).animate({width: '-=25'}, 450); 
   });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜