最新回答 / _小_七_
                                
                                                            if(currentId){                var _Link=getByClassName(document.getElementById("menu"),"current");                var _href=_Link.getAttribute("href");                var _menu=document.getElementById("menu");                                if(_href!="#"+...
                            
                        
                        2016-05-19
                
            
                                已采纳回答 / lewandowski
                                
                                                             var top = $(document).scrollTop;这里少了个括号,应该是 var top = $(document).scrollTop();
                            
                        
                        2016-05-11
                
            
                                已采纳回答 / Sfilata
                                
                                                            这句话的意思是获取你现在滚动位置的div的id值。m是this指针,指向运用each遍历后找到的目前的div元素,attr("id")表示获取当前元素的id属性。
                            
                        
                        2016-05-02
                
            
                                最赞回答 / weibo_哆啦A梦有大口袋_0
                                
                                                             if (currentId && currentLink.attr("href") != currentId) {}currentId等价于currentId!="",意思就是说当current有值时执行下面代码&& currentLink.attr("href") != currentId    //并且选中楼层的a标签的href不等于滚动条所在楼层的id执行下面代码,因为相同话,就不需要执行下面的代码了,节约性能解决问题,请采纳
                            
                        
                        2016-04-28
                
            
                                最新回答 / 貔貅最帅
                                
                                                            首先 你要获取 当前位置的 offsetTop  i 和 你要跳到的 offsetTop  j   判断i和j谁大  当点击导航时      for (i =j;i++) document.body.scrollTop(i); 或者 for (i =j;i--) document.body.scrollTop(i); 
                            
                        
                        2016-04-26
                
            
                                最赞回答 / 亚特兰大
                                
                                                            哦,还有一个我最先改的,忘了说,var top=document.documentElement?document.documentElement.scrollTop:document.body.scrollTop;改成var top=document.documentElement。scrollTop?document.documentElement.scrollTop:document.body.scrollTop;你再试下。。。
                            
                        
                        2016-04-22
                
             
             
        












