jQuery的Scrollify插件实现滑动到页面下一节点

前端之家收集整理的这篇文章主要介绍了jQuery的Scrollify插件实现滑动到页面下一节点前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

有时我们需要做一个单页面介绍产品特性,而单页面内容非常多且页面非常长,为了快速定位到产品特性节点,我们使用js侦听用户滚轮事件,当用户触发滚轮滑动或者使用手势触屏滑动时,即可定位到相应的节点。一款jQuery插件叫Scrollify帮我们做到了。

Scrollify需要jQuery 1.6+以及缓冲动画easing插件配合来实现。HTML基本结构如下:

<Meta charset="utf-8"> scrollify@H_<a href="https://www.jb51.cc/tag/404/" target="_blank" class="keywords">404</a>_8@ <!--[if lt IE 9]> <script src="html5shiv.min.js"></script> <![endif]--> <script src="jquery.js"></script> <script src="jquery.easing.min.js"></script> <script src="jquery.scrollify.min.js"></script> <script> $(function() { $.scrollify({ section : "section",}); }); </script> </head> <body> <section></section> <section></section> </body> </html> </pre> </div> <p>以下是scrollify的默认选项配置:</p> <div class="jb51code"> <pre class="brush:js;"> $.scrollify({ section : "section",sectionName : "section-name",easing: "ea<a href="https://www.jb51.cc/tag/SEO/" title="SEO">SEO</a>utExpo",scrollSpeed: 1100,offset : 0,scrollbars: true,before:function() {},after:function() {} }); </pre> </div> <p>选项说明: </p> <p>section:节点部分选择器. sectionName:每一个section节点对应的data<a href="https://www.jb51.cc/tag/shuxing/" target="_blank" class="keywords">属性</a>. easing:定义缓冲动画. offset:定义每个色彩tion节点的偏移量. scrollbars:是否<a href="https://www.jb51.cc/tag/xianshi/" target="_blank" class="keywords">显示</a>滚动条. before:回调<a href="https://www.jb51.cc/tag/hanshu/" target="_blank" class="keywords">函数</a>,滚动开始前触发. after:回调<a href="https://www.jb51.cc/tag/hanshu/" target="_blank" class="keywords">函数</a>,滚动完成后触发.</p> <p>Scrollify还提供了<a href="https://www.jb51.cc/tag/fangfa/" target="_blank" class="keywords">方法</a><a href="https://www.jb51.cc/tag/diaoyong/" target="_blank" class="keywords">调用</a>,如:</p> <div class="jb51code"> <pre class="brush:js;"> $.scrollify("move","#name"); </pre> </div> <p>以上<a href="https://www.jb51.cc/tag/daima/" target="_blank" class="keywords">代码</a>可以直接滚动到#name的节点。</p> <p>以上所述就是本文的全部<a href="https://www.jb51.cc/tag/neirong/" target="_blank" class="keywords">内容</a>了,希望大家能够喜欢。</p><i class="glyphicon glyphicon-link"></i> 原文链接:https://www.f2er.com/jquery/53515.html</div> <div class="topcard-tags"><a href="https://www.f2er.com/tag/jQuery/" class="tag_link" target="_blank">jQuery</a><a href="https://www.f2er.com/tag/Scrollify/" class="tag_link" target="_blank">Scrollify</a></div> <ul class="list-group"> <li class="list-group-item"><a href="https://www.f2er.com/jquery/53524.html" title="jQuery动态背景图片效果实现方法">上一篇:jQuery动态背景图片效果实现方法</a><a href="https://www.f2er.com/jquery/53510.html" title="jQuery 遍历函数详解" class="text-muted pull-right">下一篇:jQuery 遍历函数详解</a> </li> </ul> </div> </div> </div> <!-- row end --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-4605373693034661" data-ad-slot="9144498553"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div> </div> </div> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <div class="title"><h1>猜你在找的jQuery相关文章</h1></div> <div class="list_con"> <a href="https://www.f2er.com/jquery/994522.html" title="《锋利的jQuery》笔记:插件的使用和写法"><div class="title">《锋利的jQuery》笔记:插件的使用和写法</div> <div class="summary">jQuery插件的种类 1、封装对象方法 这种插件是将对象方法封装起来,用于对通过选择器获取的...</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/jquery/994521.html" title="jQuery插件开发入门"><div class="title">jQuery插件开发入门</div> <div class="summary">扩展jQuery插件和方法的作用是非常强大的,它可以节省大量开发时间。 入门 编写一个jQuery...</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/jquery/994520.html" title="jquery.roundabout.js实现3D图片层叠旋转木马切换"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2020/12-28/08/dffb45ce0cf3e295e280f6fb71053099.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">jquery.roundabout.js实现3D图片层叠旋转木马切换</div> <div class="summary">最近项目中需要实现3D图片层叠旋转木马切换的效果,于是用到了jquery.roundabout.js。 兼容...</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/jquery/994519.html" title="jQuery效果之jQuery实现图片的依次加载图片"><div class="title">jQuery效果之jQuery实现图片的依次加载图片</div> <div class="summary">css代码: js代码:</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/jquery/994518.html" title="jQuery之deferred对象详解"><div class="title">jQuery之deferred对象详解</div> <div class="summary">一、什么是deferred对象? 开发网站的过程中,我们经常遇到某些耗时很长的javascript操作。...</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div style="border-bottom: 1px solid #f4f4f4;margin-top:20px;"> <ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-fr-2o+fp-dx-wx" data-ad-client="ca-pub-4605373693034661" data-ad-slot="4561116489"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div><div class="list_con"> <a href="https://www.f2er.com/jquery/994516.html" title="jQuery插件开发进阶"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2020/12-28/08/cf0a3ddd7df38e4fd13375e560fd833a.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">jQuery插件开发进阶</div> <div class="summary">jQuery插件开发模式 软件开发过程中是需要一定的设计模式来指导开发的,有了模式,我们就能...</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/jquery/994515.html" title="jQuery 实现邮箱输入自动提示功能:(一)"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2020/12-28/08/495a5225e66f1d897f5b3ccf684c9dd1.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">jQuery 实现邮箱输入自动提示功能:(一)</div> <div class="summary">记得去年做某个项目的时候,用到了邮箱输入自动提示功能,于是网上搜了一下,发现了这个写...</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/jquery/994514.html" title="jQuery插件之上传文件ajaxfileupload.js源码与使用"><div class="title">jQuery插件之上传文件ajaxfileupload.js源码与使用</div> <div class="summary">在网页应用中,一般会用到上传文件或者图片什么的到服务器,那么可以用ajaxfileupload.js,...</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/jquery/994513.html" title="jQuery效果之封装一个文章图片弹出放大效果"><div class="title">jQuery效果之封装一个文章图片弹出放大效果</div> <div class="summary">首先先搭写一个基本的格式: 然后用自调用匿名函数包裹你的代码,将系统变量以变量形式传递...</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/jquery/994512.html" title="《从零开始学习jQuery》:用jQuery操作元素的属性与样式"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2020/12-28/08/c7ddac708bcf22aec7f66ac24509d2ca.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">《从零开始学习jQuery》:用jQuery操作元素的属性与样式</div> <div class="summary">元素属性和Dom属性简介 对于下面这样一个标签元素: 我们通常将id,src,alt,class称为属性,也...</div> <time class="summary">作者:前端之家 时间:2020-12-28</time> </a> </div> <div style="border-bottom: 1px solid #f4f4f4;margin-top:20px;"> <ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-fr-2o+fp-dx-wx" data-ad-client="ca-pub-4605373693034661" data-ad-slot="4561116489"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div></div> </div> </div> </div> <!-- left end--> <!-- right --> <div class="col-sm-12 col-md-12 col-lg-3"> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <label class="main-content-label ">编程分类</label> <div class="cate mt-20"><a href="https://www.f2er.com/html/" title="HTML">HTML</a><a href="https://www.f2er.com/html5/" title="HTML5">HTML5</a><a href="https://www.f2er.com/js/" title="JavaScript">JavaScript</a><a href="https://www.f2er.com/css/" title="CSS">CSS</a><a href="https://www.f2er.com/jquery/" title="jQuery">jQuery</a><a href="https://www.f2er.com/bootstrap/" title="Bootstrap">Bootstrap</a><a href="https://www.f2er.com/angularjs/" title="Angularjs">Angularjs</a><a href="https://www.f2er.com/typescript/" title="TypeScript">TypeScript</a><a href="https://www.f2er.com/vue/" title="Vue">Vue</a><a href="https://www.f2er.com/dojo/" title="Dojo">Dojo</a><a href="https://www.f2er.com/json/" title="Json">Json</a><a href="https://www.f2er.com/electron/" title="Electron">Electron</a><a href="https://www.f2er.com/nodejs/" title="Node.js">Node.js</a><a href="https://www.f2er.com/extjs/" title="extjs">extjs</a><a href="https://www.f2er.com/express/" title="Express ">Express </a><a href="https://www.f2er.com/xml/" title="XML">XML</a><a href="https://www.f2er.com/es6/" title="ES6">ES6</a><a href="https://www.f2er.com/ajax/" title="Ajax">Ajax</a><a href="https://www.f2er.com/flash/" title="Flash">Flash</a><a href="https://www.f2er.com/unity/" title="Unity">Unity</a><a href="https://www.f2er.com/react/" title="React">React</a><a href="https://www.f2er.com/flex/" title="Flex">Flex</a><a href="https://www.f2er.com/antdesign/" title="Ant Design">Ant Design</a><a href="https://www.f2er.com/webfrontend/" title="Web前端">Web前端</a><a href="https://www.f2er.com/weapp/" title="微信小程序">微信小程序</a><a href="https://www.f2er.com/wxmp/" title="微信公众号">微信公众号</a><div class="clearfix"></div> </div> </div> </div> </div> <!-- row end --> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <!-- f2er-rightads --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4605373693034661" data-ad-slot="7756441254" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> </div> <!-- row end --> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <label class="main-content-label ">最新文章</label> <ul class="n-list"><li><a href="https://www.f2er.com/jquery/994522.html" title="《锋利的jQuery》笔记:插件的使用和写法" target="_blank">• 《锋利的jQuery》笔记:插</a></li> <li><a href="https://www.f2er.com/jquery/994521.html" title="jQuery插件开发入门" target="_blank">• jQuery插件开发入门</a></li> <li><a href="https://www.f2er.com/jquery/994520.html" title="jquery.roundabout.js实现3D图片层叠旋转木马切换" target="_blank">• jquery.roundabout.js实现</a></li> <li><a href="https://www.f2er.com/jquery/994519.html" title="jQuery效果之jQuery实现图片的依次加载图片" target="_blank">• jQuery效果之jQuery实现图</a></li> <li><a href="https://www.f2er.com/jquery/994518.html" title="jQuery之deferred对象详解" target="_blank">• jQuery之deferred对象详解</a></li> <li><a href="https://www.f2er.com/jquery/994517.html" title="jQuery 对AMD的支持(Require.js中如何使用jQuery)" target="_blank">• jQuery 对AMD的支持(Requ</a></li> <li><a href="https://www.f2er.com/jquery/994516.html" title="jQuery插件开发进阶" target="_blank">• jQuery插件开发进阶</a></li> <li><a href="https://www.f2er.com/jquery/994515.html" title="jQuery 实现邮箱输入自动提示功能:(一)" target="_blank">• jQuery 实现邮箱输入自动提</a></li> <li><a href="https://www.f2er.com/jquery/994514.html" title="jQuery插件之上传文件ajaxfileupload.js源码与使用" target="_blank">• jQuery插件之上传文件ajax</a></li> <li><a href="https://www.f2er.com/jquery/994513.html" title="jQuery效果之封装一个文章图片弹出放大效果" target="_blank">• jQuery效果之封装一个文章</a></li> </ul> </div> </div> </div> <!-- row end --> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <label class="main-content-label ">热门标签 <span class="pull-right tx-12"> <a href="https://www.f2er.com/all" target="_blank">更多 ►</a></span> </label> <div class="topcard-tags"><a href="https://www.f2er.com/tag/guanbiyangao/" title="关闭广告" target="_blank">关闭广告</a><a href="https://www.f2er.com/tag/danduheaders/" title="单独headers" target="_blank">单独headers</a><a href="https://www.f2er.com/tag/fengzhuangdaima/" title="封装代码" target="_blank">封装代码</a><a href="https://www.f2er.com/tag/tishicuowu/" title="提示错误" target="_blank">提示错误</a><a href="https://www.f2er.com/tag/zhengshuzhengze/" title="整数正则" target="_blank">整数正则</a><a href="https://www.f2er.com/tag/fei0kaitou/" title="非0开头" target="_blank">非0开头</a><a href="https://www.f2er.com/tag/tiaoye/" title="跳页" target="_blank">跳页</a><a href="https://www.f2er.com/tag/chuyema/" title="出页码" target="_blank">出页码</a><a href="https://www.f2er.com/tag/antdtable/" title="antd table" target="_blank">antd table</a><a href="https://www.f2er.com/tag/tishiURLweizhuce/" title="提示URL未注册" target="_blank">提示URL未注册</a><a href="https://www.f2er.com/tag/gongzhonghaozhifu/" title="公众号支付" target="_blank">公众号支付</a><a href="https://www.f2er.com/tag/vuehashmoshi/" title="vue hash模式" target="_blank">vue hash模式</a><a href="https://www.f2er.com/tag/iSlider/" title="iSlider" target="_blank">iSlider</a><a href="https://www.f2er.com/tag/chepaijianpan/" title="车牌键盘" target="_blank">车牌键盘</a><a href="https://www.f2er.com/tag/xunhuantupian/" title="循环图片" target="_blank">循环图片</a><a href="https://www.f2er.com/tag/echartsshuangzhexian/" title="echarts 双折线" target="_blank">echarts 双折</a><a href="https://www.f2er.com/tag/zuoyoubuju/" title="左右布局" target="_blank">左右布局</a><a href="https://www.f2er.com/tag/DllPlugin/" title="DllPlugin" target="_blank">DllPlugin</a><a href="https://www.f2er.com/tag/duixiangchuangjian/" title="对象创建" target="_blank">对象创建</a><a href="https://www.f2er.com/tag/daziyouxi/" title="打字游戏" target="_blank">打字游戏</a><a href="https://www.f2er.com/tag/quanxuan/" title="圈选" target="_blank">圈选</a><a href="https://www.f2er.com/tag/lianglan/" title="两栏" target="_blank">两栏</a><a href="https://www.f2er.com/tag/yunhanshu/" title="云函数" target="_blank">云函数</a><a href="https://www.f2er.com/tag/mengban/" title="蒙版" target="_blank">蒙版</a><a href="https://www.f2er.com/tag/ES2020/" title="ES2020" target="_blank">ES2020</a><a href="https://www.f2er.com/tag/chuchuang/" title="橱窗" target="_blank">橱窗</a><a href="https://www.f2er.com/tag/wufenggundonglunbo/" title="无缝滚动轮播" target="_blank">无缝滚动轮播</a><a href="https://www.f2er.com/tag/sekuaipengzhuang/" title="色块碰撞" target="_blank">色块碰撞</a><a href="https://www.f2er.com/tag/zujianxiaohui/" title="组件销毁" target="_blank">组件销毁</a><a href="https://www.f2er.com/tag/wendangcaozuo/" title="文档操作" target="_blank">文档操作</a></div> </div> </div> </div> <!-- row end --> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <!-- f2er-rightads --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4605373693034661" data-ad-slot="7756441254" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> </div> <!-- row end --> </div> <!-- right end --> </div> </div> <footer id="footer"> <div class="container"> <div class="row hidden-xs"> <dl class="col-sm-6 site-link"> <dt>最近更新</dt><dd><a href="https://www.f2er.com/faq/884225.html" title="jQuery选择伪元素:after" target="_blank">· jQuery选择伪元素:after</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884224.html" title="JavaScript随机颜色生成器" target="_blank">· JavaScript随机颜色生成器</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884223.html" title="JavaScript指数" target="_blank">· JavaScript指数</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884222.html" title="addResourceHandlers无法解析静态资源" target="_blank">· addResourceHandlers无法解析静态资源</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884221.html" title="如何将字节数组转换为MultipartFile" target="_blank">· 如何将字节数组转换为MultipartFile</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884220.html" title="在java中如何创建一个文件并写入内容?" target="_blank">· 在java中如何创建一个文件并写入内容?</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884219.html" title="星号*在Python中是什么意思?" target="_blank">· 星号*在Python中是什么意思?</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884218.html" title="Flask框架:MVC模式" target="_blank">· Flask框架:MVC模式</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884217.html" title="在JavaScript对象数组中按ID查找对象" target="_blank">· 在JavaScript对象数组中按ID查找对象</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884216.html" title="使用Javascript / jQuery下载文件" target="_blank">· 使用Javascript / jQuery下载文件</a><span class="text-muted pull-right">10-20</span></dd> </dl> <dl class="col-sm-4 site-link"> <dt>好站推荐</dt><dd> <a href="https://www.runoob.com" title="菜鸟教程(www.runoob.com)提供了编程的基础技术教程, 介绍了HTML、CSS、Javascript、Python,Java,Ruby,C,PHP , MySQL等各种编程语言的基础知识。 同时本站中也提供了大量的在线实例,通过实例,您可以更好的学习编程。" target="_blank">菜鸟教程</a></dd><dd> <a href="https://www.jb51.cc" title="编程之家(www.jb51.cc)是成立于2017年面向全球中文开发者的技术内容分享平台。提供编程导航、编程问答、编程博文、编程百科、编程教程、编程工具、编程实例等开发者最需要的编程技术内容与开发工具支持,与你一起学习编程,相信编程改变未来!" target="_blank">编程之家</a></dd><dd> <a href="https://www.f2er.com" title="前端之家 f2er.com 前端开发人员所需学习知识手册。" target="_blank">前端之家</a></dd></dl> <dl class="col-sm-2 site-link"> <dt>商务合作</dt> <dd><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=76874919&site=qq&menu=yes">联系我们</a></dd> </dl> </div> <div class="copyright"> Copyright © 2019 前端之家. 当前版本 V7.0.16<br> <span class="ml5">前端之家 版权所有 <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">闽ICP备13020303号-10</a></span> </div> </div> </footer> <script type="text/javascript" src="https://www.f2er.com/js/base.js"></script> </body> </html>