fullPage.js插件使用(一)
2015-12-31 11:44
736 查看
fullPage.js的方法:
1. moveSectionUp()
功能:向上滚动一页。
2. moveSectionDown()
功能:向下滚动一页。
3. moveTo(section, slide)
功能:滚动到第几页的第几个幻灯片。
注意:页面是从1开始,幻灯片是从0开始。
4. silentMoveTo(section, slide)
功能:滚动到第几页的第几个幻灯片,但是没有动画效果。
5. moveSlideRight()
功能:幻灯片向右滚动。
6. moveSlideLeft()
功能:幻灯片向左滚动。
7. setAutoScrolling(boolean)
功能:动态设置autoScrolling。
8. setLockAnchors(boolean)
功能:动态设置lockAnchors。
9. setRecordHistory(boolean)
功能:动态设置recordHistory。
10. setScrollomgSpeed(milliseconds)
功能:动态设置scrollingSpeed。
11. setAllowScrolling(boolean,[directions])
功能:添加或者删除鼠标滚轮/滑动控制。第一个参数true为启用,false为禁用。
后面的参数为方向,取值包含all, up, down, left, right,可以使用多个,逗号隔开。
fullPage.js的回调函数:
1. afterLoad(anchorLink, index)
功能:滚动到某一section,并且滚动结束后,会触发一次回调函数,函数接收anchorLink和index两个参数,anchorLink是锚链接的名称,index是序号,从1开始 计算。
例如:
afterLoad:function(anchorLink, index){ console.log("anchorLink:"+anchorLink+"\t index:"+index); },
2. onLeave(index, nextIndex,direction)
功能:在离开一个section时,会触发一次调回函数,接收index、nextIndex和direction 三个参数。
index是离开页面的序列号,从1开始算起;
nextIndex是滚动到目标页面的序列号,从1开始算起。
direction是判断向上还是向下滚动,值为up或down。
例如:
onLeave:function(index,nextIndex,direction){ console.log("index:"+index+" nextIndex:"+nextIndex+" direction:"+direction); },
3. afterRender()
功能:页面结构生成后的回调函数,或者说是页面初始化完成后的回调函数。
例子:
afterRender:function(){ console.log("afterRender"); },
4. afterResize()
功能:浏览器窗口尺寸改变后的回调函数。
例子:
afterResize:function(){ console.log("afterResize"); },
5. afterSlideLoad(anchorLink, index, slideAnchor, slideIndex)
功能:滚动到某一幻灯片后的回调函数,与afterLoad类似。slideAnchor、slideIndex起始值为0。
例子:
afterSlideLoad:function(anchorLink, index, slideAnchor, slideIndex){ console.log("anchorLink:" + anchorLink +" index:" + index +" slideAnchor:" + slideAnchor +" slideIndex:" + slideIndex ); },
6. onSlideLeave(anchorLink, index, slideAnchor, direction, slideIndex)
功能:在离开一个slide时,会触发一次的回调函数,与onLeave类似。direction的值为left或者right。slideAnchor、slideIndex起始值为0。
例子:
onSlideLeave:function(anchorLink, index, slideAnchor, direction, slideIndex){ console.log("anchorLink:" + anchorLink +" index:" + index +" slideAnchor:" + slideAnchor +" direction:" + direction +" slideIndex:" + slideIndex ); },
相关文章推荐
- js中数组 与 对象的区别
- PromiseJs
- js去除空格
- JavaScript最佳实践,持续更新
- Session 与 jsessionid
- moment.js 日期和时间管理 24小时制
- 页面加载完再触发js
- javascript数据类型验证方法
- js 面向对象
- 如何编写一个JSON解析器
- 使用Web Audio API实现基于浏览器的Web端录音
- JavaScript 中 关于 this 的学习笔记
- Newtonsoft.Json高级用法
- js中的面向对象
- js中this的用法
- javascript图片延迟加载实现方法及思路
- 第八届河南省赛 zzuoj 10408: C.最少换乘 (djs&&字符串转数字)
- js在页面显示当前时间、日期
- 求JS无预览打印解决方案
- JSTL标签 参考手册