0

当我在此页面中向下滚动时,左侧上下文菜单会同时切换其样式。如何使用 jQuery 实现这种效果?

4

1 回答 1

1
var t = $("#anchor-point").offset().top;

 $(document).scroll(function(){
   if($(this).scrollTop() > t)
   {   
      $('#voice2').css({"border-bottom":"2px solid #f4f5f8"});
      $('#voice3').css({"border-bottom":"2px solid #2e375b"});
   }
 });

参考

快乐编码:)

于 2013-06-01T08:18:41.890 回答