jquery.fullPage.js全屏滚动插件的使用方法
来源:互联网 发布:淘宝透明下拉栏 编辑:程序博客网 时间:2024/05/17 22:21
兼容性:
- 支持 IE8+ 及其他现代浏览器。
主要功能:
1.支持鼠标滚动;
2.支持前进后退键盘控制;
3.多个回调函数;
4.支持手机.移动设备;
5.支持窗口缩放自动调整;
6.可设置滚动宽度、背景颜色、滚动速度、循环选项、回调、文本对齐方式等等;
7.支持CSS3动画;
github下载地址:https://github.com/alvarotrigo/fullPage.js
滚屏里面的效果,都是写在回调函数中的;
配置表:
1.选项
2.方法:
- moveSectionUp() 向上滚动
- moveSectionDown() 向下滚动
- moveTo(section, slide) 滚动到
- moveSlideRight() slide 向右滚动
- moveSlideLeft() slide 向左滚动
- setAutoScrolling() 设置页面滚动方式,设置为 true 时自动滚动
- setAllowScrolling() 添加或删除鼠标滚轮/触控板控制
- setKeyboardScrolling()添加或删除键盘方向键控制
- setScrollingSpeed() 定义以毫秒为单位的滚动速度
3、回调函数
nextIndex 是滚动到的“页面”的序号,从1开始计算;
direction 判断往上滚动还是往下滚动,值是 up 或 down。
afterRender页面结构生成后的回调函数,或者说页面初始化完成后的回调函数afterSlideLoad滚动到某一水平滑块后的回调函数,与 afterLoad 类似,接收 anchorLink、index、slideIndex、direction 4个参数onSlideLeave某一水平滑块滚动前的回调函数,与 onLeave 类似,接收 anchorLink、index、slideIndex、direction 4个参数个别代码示例:
$(function(){ //fullpage.js全屏滚动插件效果; $('#dowebok').fullpage({ sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', '#f90'], //滚动到某一屏后调用js代码 afterLoad: function(anchorLink, index){ if(index == 2){ //进入第二个页面左边的div出现的效果; $('.animation_effect .left').delay(500).animate({ width: '60%' }, 1500, 'easeOutExpo'); //进入第二个页面右边三个div出现的效果; $('.animation_effect .top,.animation_effect .center,.animation_effect .bottom').delay(500).animate({ width:'40%' },1500,'easeOutExpo'); //鼠标进入左边的div,左边的div和右边三个div宽度发生变化; $('.animation_effect .left').mouseover(function(){ $(this).stop().animate({ width:'69%' },1500, 'easeOutExpo'); $('.animation_effect .top,.animation_effect .center,.animation_effect .bottom').stop().animate({ width:'31%' },1500,'easeOutExpo') }); //鼠标离开左边的div,左边div和右边div宽度发生变化; $('.animation_effect .left').mouseout(function(){ $(this).stop().animate({ width:'60%' },1500, 'easeOutExpo'); $('.animation_effect .top,.animation_effect .center,.animation_effect .bottom').stop().animate({ width:'40%' },1500,'easeOutExpo') }); //鼠标在左边的left的div中指定的坐标内移动的时候; $('.left').mousemove(function(e){ //console.log(e.offsetX +":" + e.offsetY) if(e.offsetX>460){ //$('.animation_effect .left').stop().animate({ // width:'69-460'+e.offsetX+'%' //},1500, 'easeOutExpo'); console.log("dasfaf") } }) //鼠标进入右边的三个div,四个div出现的效果 $('.animation_effect .top,.animation_effect .center,.animation_effect .bottom').mouseover(function(){ $('.animation_effect .top,.animation_effect .center,.animation_effect .bottom').stop().animate({ width:'49%' },1500,'easeOutExpo'); $('.animation_effect .left').stop().animate({ width:'51%' },1500, 'easeOutExpo'); }) //鼠标离开右边的三个div,四个div出现的效果; $('.animation_effect .top,.animation_effect .center,.animation_effect .bottom').mouseout(function(){ $('.animation_effect .top,.animation_effect .center,.animation_effect .bottom').stop().animate({ width:'40%' },1500,'easeOutExpo'); $('.animation_effect .left').stop().animate({ width:'60%' },1500, 'easeOutExpo'); }) } //当页面在首页的时候,点击视频关闭按钮,出现的效果; if(index == 1){ } if(index == 4){ $('.section4').find('p').fadeIn(2000); } }, //滚动到某一屏前,或者这一屏幕滚动过后执行的js代码; onLeave: function(index, direction){ if(index == '2'){ $('.left').delay(450).animate({ width: '100%' }, 1500, 'easeOutExpo'); $('.top,.center,.bottom').delay(450).animate({ width:'0' },1500,'easeOutExpo') } if(index == '3'){ $('.section3').find('p').delay(500).animate({ bottom: '-120%' }, 1500, 'easeOutExpo'); } if(index == '4'){ $('.section4').find('p').fadeOut(2000); } } });});
阅读全文
0 0
- jquery.fullPage.js全屏滚动插件的使用方法
- jQuery-全屏滚动插件【fullPage.js】API 使用方法总结
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js演示
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件FullPage.js
- jQuery全屏滚动插件fullPage.js
- fullPage.js-jQuery全屏滚动插件(1)
- jQuery全屏滚动插件fullPage.js
- restful风格,restcontroller与controller
- Visual Studio2010"当前不会命中代码,源代码与原始版本不同"问题的解决方法
- dom4j解析xml练习源码
- 推荐一款前端轻量级的toolTip插件-Tippy.js
- 使用 Virtual Box 加载一个Unbuntu
- jquery.fullPage.js全屏滚动插件的使用方法
- spring aop同时代理service层和controller层的问题
- delphi messagebox中string转ansichar 问题
- Android蓝牙开发【三】蓝牙Hid开发
- python 用turtle库绘制时钟
- MySQL中myisam和innodb的主键索引有什么区别?
- mysql导入导出
- liunx的基础命令-02
- 微信注册崩溃?appid签名无法注册or如何查看签名是否一致?如何注册appid?jks和keystore的区别?