菜单高亮滚动监听
来源:互联网 发布:linux查看本地arp缓存 编辑:程序博客网 时间:2024/06/01 21:29
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> *{ margin: 0;padding: 0;} .main{ width: 1200px; margin: 0 auto;} .m-cloumn{ height: 300px; margin-bottom: 15px; border: 1px solid #ddd; box-shadow: 0 5px 5px -5px #f00;} .right-cloumn{ position:fixed; width: 120px; top: 100px;right: 50px; border: 1px solid #ddd;} .right-cloumn a{ display: block; height: 40px; line-height: 40px; border-bottom: 1px solid #eee; text-align: center;} .right-cloumn .curr{ background: #F0AD4E; color: #fff;} </style> </head> <body> <div class="main"> <div class="m-cloumn" id="c1"> <h2>栏目1</h2> </div> <div class="m-cloumn" id="c2"> <h2>栏目2</h2> </div> <div class="m-cloumn" id="c3"> <h2>栏目3</h2> </div> <div class="m-cloumn" id="c4"> <h2>栏目4</h2> </div> <div class="m-cloumn" id="c5"> <h2>栏目5</h2> </div> <div class="m-cloumn" id="c6"> <h2>栏目6</h2> </div> <div class="m-cloumn" id="c7"> <h2>栏目7</h2> </div> </div> <div class="right-cloumn"> <a href="#c1" class="curr">栏目1</a> <a href="#c2">栏目2</a> <a href="#c3">栏目3</a> <a href="#c4">栏目4</a> <a href="#c5">栏目5</a> <a href="#c6">栏目6</a> <a href="#c7">栏目7</a> </div><script src="http://static.gutou.com/js/common.js?2015071101.js" type="text/javascript"></script><script> (function($,win,doc){ var scroll_rsilder={ win_evet:function(){ $(win).bind("scroll",function(){ var scrollTop=$(this).scrollTop(); _this.ele_evet(scrollTop); }) }, ele_evet:function(scrollTop){ $(this.cloumn).each(function(index){ var offsetTop=$(this).offset().top; xd=parseInt(offsetTop-scrollTop); if(xd<_this.spacing) $(_this.silder).eq(index).addClass(_this.curr).siblings().removeClass(); }) }, init:function(obj){ _this=this, this.cloumn=obj.cloumn, this.silder=obj.silder, this.spacing=obj.spacing||100, this.curr=obj.curr||"curr"; if(!this.cloumn) return; this.win_evet(); } } win.scroll_rsilder=scroll_rsilder; })(jQuery,window,document) </script> <script> $(function(){ scroll_rsilder.init({ cloumn:".m-cloumn", silder:".right-cloumn a", spacing:80, curr:"curr" }) }) </script> </body></html>
0 0
- 菜单高亮滚动监听
- 滚动监听 滚屏与菜单联动
- bootstrap(下拉菜单与滚动监听)
- bootstrap下拉菜单和滚动监听插件
- Bootstrap 下拉菜单和滚动监听(Scrollspy)插件
- 滚动监听
- 滚动监听
- 滚动菜单
- 菜单点击高亮显示
- 菜单跳转高亮问题
- SlidingMenu源码分析及拓展:监听拉出菜单时的滚动事件,将主页变暗
- vue监听滚动事件实现滚动监听
- android 监听 webview 滚动
- bootstrap滚动监听
- ViewPager滚动监听解释
- 监听scrollview滚动
- ScrollView滚动监听
- ScrollView滚动监听事件
- 计算机基础知识温故而知新
- 为什么静态成员、静态方法中不能用this和super关键字
- Eclipse去除js(JavaScript)验证错误
- 【笔试/面试】—— 判断一个链表是否有环
- 在项目什么时候选择使用GCD,什么时候选择NSOperation
- 菜单高亮滚动监听
- python jieba 分词自定义字典
- 数据结构复习整理(易混点、易忘点)
- Spring中Bean的作用域
- 解决方案之——应用的图标总是默认的机器人
- Could not resolve all dependencies for configuration ':XXX:_debugCompile'
- django--模板的继承
- python 迭代器与生成器
- android 防止Button的频繁点击,多次执行点击事件