我的console.log(top) ,这两个高火狐,谷歌都打不出啦社呢原因呢?帮我看看咯
<script src="../js/jquery-2.1.0.js"></script>
<script type="text/css">
$(docment).ready(function(){
$(window).scroll(function(){
var top = $(document).scrollTop();
var menu = $("#menu");
var items = $("#content").find(".item");
var currentId=""; //给楼层设置id
items.each(function(){
var t= $(this);
var itemtop = t.offset().top;
if(top > itemtop){
currentId = "#"+ t.attr("id"); //给相印的楼层a设置current,取消其他相关的current
}else{
return false;
}
});
console.log(top);
});
});