这甚至是假设通过向下添加类来移动div。但它提前? 。标题没有打到顶部,它已经在旅途中!?jquery切换类不能完全工作
$(document).ready(function(){
$(window).scroll(function() {
var moveit = $('.title'), //the titles are to move
targetScroll = $('.title').position().top, //when .title is at top
currentScroll = $(document.body).scrollTop();
moveit.toggleClass('down', currentScroll >= targetScroll);
});
});
#box #left ul li:hover .down {
top: 500px;
}
.down包含的方式提前。
我在做什么错......它盯着我脸上不是吗?
你的代码的工作:http://jsfiddle.net/RVbCq/就非常有可能的CSS问题更多。 – 2012-02-27 22:23:26