Jquery animate with css float
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i have a problem with my code, the width seems to work but the float no. Here it is: HERE IS AN EXAMPLE: http://jsfiddle.net/v82ck/ THE PROBLEM: the float property on the menu when hovering doesnt change, i want the line below each menu element to slide below the element when hovering that menu element. the code isnt complicated, i just dont know what is happening JAVASCRIPT : $(document).ready(function () { $('#line-menu').css({ //initial state 'float': 'left', 'width' : $('#menu-1').width(), }); $('#menu-1').hover(function(){ //first menu