fullpage函数里面的参数:

//Navigation
menu: false,//绑定菜单,设定的相关属性与anchors的值对应后,菜单可以控制滚动,默认为false。
anchors:['firstPage', 'secondPage'],//anchors定义锚链接,默认为[]
lockAnchors: false,//是否锁定锚链接,默认为false,设为true后链接地址不会改变
navigation: false,//是否显示导航,默认为false
navigationPosition: 'right',//导航小圆点的位置
navigationTooltips: ['firstSlide', 'secondSlide'],//导航小圆点的提示
showActiveTooltip: false,//是否显示当前页面的tooltip信息
slidesNavigation: true,//是否显示横向幻灯片的导航,默认为false
slidesNavPosition: 'bottom',//横向导航的位置,默认为bottom,可以设置为top或bottom

//Scrolling
css3: true,//是否使用CSS3 transforms来实现滚动效果,默认为true
scrollingSpeed: 700,//设置滚动速度,单位毫秒,默认700
autoScrolling: true,//是否使用插件的滚动方式,默认为true,若为false则会出现浏览器自带滚动条
fitToSection: true,//设置是否自适应整个窗口的空间,默认值:true
scrollBar: false,//是否包含滚动条,默认为false,若为true浏览器自带滚动条出现
easing: 'easeInOutCubic',//定义页面section滚动的动画方式,若修改此项需引入jquery.easing插件
easingcss3: 'ease',//定义页面section滚动的过渡效果,若修改此项需引入第三方插件
loopBottom: false,//滚动到最低部后是否连续滚动到顶部,默认为false
loopTop: false,//滚动到最顶部后是否连续滚动到底部,默认为false
loopHorizontal: true,//横向slide幻灯片是否循环滚动,默认为true
continuousVertical: false,//是否循环滚动,不兼容loopTop和loopBottom选项
normalScrollElements: '#element1, .element2',//避免自动滚动,滚动时的一些元素,例如百度地图
scrollOverflow: false,//内容超过满屏后是否显示滚动条,true则显示滚动条,若需滚动查看内容还需要jquery.slimscroll插件的配合
touchSensitivity: 15,//在移动设备中滑动页面的敏感性,默认为5最高100,越大越难滑动
normalScrollElementTouchThreshold: 5,

//Accessibility
keyboardScrolling: true,//是否可以使用键盘方向键导航,默认为true
animateAnchor: true,//锚链接是否可以控制滚动动画,默认为true,若为false则锚链接定位失效
recordHistory: true,//是否记录历史,默认为true,浏览器的前进后退可导航。若autoScrolling:false,那么这个属性将被关闭

//Design
controlArrows: true,//定义是否通过箭头来控制slide,默认true
verticalCentered: true,//定义每一页的内容是否垂直居中,默认true
resize : false,//字体是否随窗口缩放而缩放,默认false
sectionsColor : ['#ccc', '#fff'],//为每个section设置background-color属性
paddingTop: '3em',设置每一个section顶部的padding,默认为0
paddingBottom: '10px',设置每一个section底部的padding,默认为0
fixedElements: '#header, .footer',固定元素,默认为null,需要配置一个jquery选择器,在页面滚动时,fixElements设置的元素不滚动
responsiveWidth: 0,
responsiveHeight: 0,

//Custom selectors
sectionSelector: '.section',//section选择器。默认为.section
slideSelector: '.slide',//slide选择器,默认为.slide

//events
onLeave: function(index, nextIndex, direction){},
afterLoad: function(anchorLink, index){},
afterRender: function(){},
afterResize: function(){},
afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex){},
onSlideLeave: function(anchorLink, index, slideIndex, direction, nextSlideIndex){}

fullpage函数里面的方法:

onLeave (index, nextIndex, direction)

滚动前的回调函数,接收 index、nextIndex 和 direction 3个参数

  • index 是离开的“页面”的序号,从1开始计算;
  • nextIndex 是滚动到的“页面”的序号,从1开始计算;
  • direction 判断往上滚动还是往下滚动,值是 up 或 down。
$('#fullpage').fullpage({
onLeave: function(index, nextIndex, direction){
var leavingSection = $(this);
//after leaving section 2
if(index == 2 && direction =='down'){
alert("Going to section 3!");
}
else if(index == 2 && direction == 'up'){
alert("Going to section 1!");
}
}
});

取消section的滚动

你可以在onLeave 回调函数中返回false,那么将取消滚动。

$('#fullpage').fullpage({
onLeave: function(index, nextIndex, direction){
//it won't scroll if the destination is the 3rd section
if(nextIndex == 3){
return false;
}
}
});

afterLoad (anchorLink, index)

滚动到某一屏后的回调函数,接收 anchorLink 和 index 两个参数。

  • anchorLink 是锚链接的名称
  • index 是section的索引,从1开始计算

在没有设置锚文本的情况下,只有使用唯一的index参数。

$('#fullpage').fullpage({
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
afterLoad: function(anchorLink, index){
var loadedSection = $(this);
//using index
if(index == 3){
alert("Section 3 ended loading");
}
//using anchorLink
if(anchorLink == 'secondSlide'){
alert("Section 2 ended loading");
}
}
});

afterRender()

这个回调函数只是在生成页面结构的时候调用。这是要用来初始化其他插件或删除任何需要的文件准备好代码的回调(这个插件修改DOM创建得到的结构)。

$('#fullpage').fullpage({
afterRender: function(){
var pluginContainer = $(this);
alert("The resulting DOM structure is ready");
}
});

afterResize()

这个回调函数在窗口发生大小改变的时候被调用,就在部分调整。

$('#fullpage').fullpage({
afterResize: function(){
var pluginContainer = $(this);
alert("The sections have finished resizing");
}
});

afterSlideLoad (anchorLink, index, slideAnchor, slideIndex)

滚动到某一水平滑块后的回调函数,与 afterLoad 类似,接收 anchorLink、index、slideIndex、direction 4个参数。

  • anchorLink: anchorLink corresponding to the section.
  • index: index of the section. Starting from 1.
  • slideAnchor: anchor corresponding to the slide (in case there is)
  • slideIndex: index of the slide. Starting from 1. (the default slide doesn’t count as slide, but as a section)

在没有anchorlinks的幻灯片或幻灯片SlideIndex参数是唯一使用定义的情况下。

$('#fullpage').fullpage({
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'], afterSlideLoad: function( anchorLink, index, slideAnchor, slideIndex){
var loadedSlide = $(this); //first slide of the second section
if(anchorLink == 'secondPage' && slideIndex == 1){
alert("First slide loaded");
} //second slide of the second section (supposing #secondSlide is the
//anchor for the second slide
if(index == 2 && slideIndex == 'secondSlide'){
alert("Second slide loaded");
}
}
});

onSlideLeave (anchorLink, index, slideIndex, direction, nextSlideIndex)

某一水平滑块滚动前的回调函数,与 onLeave 类似,接收 anchorLink、index、slideIndex、direction 4个参数。

  • anchorLink: anchorLink corresponding to the section.
  • index: index of the section. Starting from 1.
  • slideIndex: index of the slide. Starting from 0.
  • direction: takes the values right or left depending on the scrolling direction.
  • nextSlideIndex: index of the destination slide. Starting from 0.
$('#fullpage').fullpage({
onSlideLeave: function( anchorLink, index, slideIndex, direction, nextSlideIndex){
var leavingSlide = $(this); //leaving the first slide of the 2nd Section to the right
if(index == 2 && slideIndex == 0 && direction == 'right'){
alert("Leaving the fist slide!!");
} //leaving the 3rd slide of the 2nd Section to the left
if(index == 2 && slideIndex == 2 && direction == 'left'){
alert("Going to slide 2! ");
}
}
});

取消slide滑动

你可以设置回调函数onSlideLeave 返回false,那么他将阻止此次的滑动事件,就像onLeave一样。

Fullpage方法函数

	$.fn.fullpage.moveSectionUp();//向上滚动一页
$.fn.fullpage.moveSectionDown();//向下滚动一页
$.fn.fullpage.moveTo(section,slide);//从1开始,slide从0开始
$.fn.fullpage.silentMoveTo(section,slide);//和moveTo一样,但是没有滚动效果
$.fn.fullpage.moveSlideRight();//幻灯片向右滚动
$.fn.fullpage.moveSlideLeft();//幻灯片向左滚动
$.fn.fullpage.setAutoScrolling(boolean);//动态设置autoScrolling
$.fn.fullpage.setLockAnchors(boolean);//动态设置lockAnchors
$.fn.fullpage.setRecordHistory(boolean);//动态设置recordHistory
$.fn.fullpage.setScrollingSpeed(milliseconds);//动态设置scrollingSpeed
$.fn.fullpage.destory(type);//销毁fullpage,type可以不写或者使用all
$.fn.fullpage.reBuild();/重新更新页面和尺寸,用于ajax请求改变页面结构后重建效果

资源延时加载

fullpage.js提供了一种懒加载图像,视频和音频元素,所以他们不会放慢您的网站加载或不必要的浪费数据传输。使用延迟加载时,所有这些元素只会加载时进入视口。启用延迟加载,所有你需要做的是改变你的src属性的data-src如下图所示:

<img data-src="data:image.png">
<video>
<source data-src="video.webm" type="video/webm" />
<source data-src="video.mp4" type="video/mp4" />
</video>
但是audio不可以:
<audio>
  <source data-src="test.mp3" type="audio/mpeg"/>
</audio>
参考原文网址:https://www.cnblogs.com/moxiaowohuwei/p/7908877.html 

fullpage.js参数参考的更多相关文章

  1. [转载]fullPage.js中文api 配置参数~

    fullPage.js中文api 配置参数 选项 类型 默认值 说明 verticalCentered 字符串 true 内容是否垂直居中 resize 布尔值 false 字体是否随着窗口缩放而缩放 ...

  2. fullpage.js的easing参数怎样配置自定义动画

    首先看非官方文档 并没有详细的说明怎样去使用easing.js,所以我加的运动属性根本就不起作用, 再看,官方文档 Optionally, when using css3:false, you can ...

  3. fullPage.js学习笔记

    中秋节,一个人呆着,挺无聊的,还是学习最有趣,不论是什么,开阔视野都是好的. 参考网址:http://www.dowebok.com/77.html  上面有详细介绍及案例展示,很不错哦,可以先去看看 ...

  4. 整屏滚动效果 jquery.fullPage.js插件+CSS3实现

    最近很流行整屏滚动的效果,无论是在PC端还是移动端,本人也借机学习了一下,主要通过jquery.funnPage.js插件+CSS3实现效果. 本人做的效果: PC端:http://demo.qpdi ...

  5. FullPage.js 活动单页 - 全屏滚动插件

    插件描述:fullPage.js 是一个基于 jQuery 的插件,它能够很方便.很轻松的制作出全屏网站. https://www.uedsc.com/fullpage.html 官网 如今我们经常能 ...

  6. jQuery全屏滚动插件fullPage.js

    github https://github.com/alvarotrigo/fullPage.js demo http://alvarotrigo.com/fullPage/ 脚手架 <link ...

  7. jquery.fullPage.js全屏滚动插件教程演示

    css部分(此处需要导入jquery.fullPage.css) <style> .section { text-align: center; font: 50px "Micro ...

  8. fullpage.js 结合固定导航栏—实现定位导航栏

    开始制作自己的个人简历啦,决定要使用固定导航栏,又打算使用fullpage.js做全屏滚动. 仔细看了fullpage文档之后,发现不用额外写js代码就可以实现以下效果: 1.当滚动翻页时,导航栏也自 ...

  9. fullPage.js

    https://github.com/alvarotrigo/fullPage.js  下载地址 demo:http://pan.baidu.com/s/1o8QWCmm 演示:http://full ...

随机推荐

  1. JAVA设计模式——开篇

    设计模式很重要,重要性我就不再复述了.最主要的是,通常我们在写一定量代码后,常用的方法什么的都熟悉后,想再提高代码能力,我找到的最好的方法还是去学习,理解设计模式.不理解设计模式,看一些开源框架和ja ...

  2. Html和Css学习笔记-css基础知识

    我的邮箱地址:zytrenren@163.com欢迎大家交流学习纠错! 此篇博客是我的复习笔记,html和css学的时间太久了,忘得差不多了,最近要使用一下,所以重新打开html的书略读,后记录了标签 ...

  3. 基于GIS的视频管理指挥平台

    平台利用空间地理信息技术,以GIS地图为基础,将各类信息空间化.可视化,实现基于空间电子地图的可视化查询和分析,它能使情报.推理.分析与其他可用数据融为一体,提供依托于电子地图的清晰而精确的现场态势图 ...

  4. Registrator中文文档

    目录 快速入门 概述 准备 运行Registrator 运行Redis 下一步 运行参考 运行Registrator Docker选项 Registrator选项 Consul ACL令牌 注册URI ...

  5. Messenger在MVVM模式中的应用

    Messenger在MVVM模式中的应用 Messenger在MVVM中应用的前提 我们知道在MVVM架构中,系统平台的Silverlight客户端界面开发和业务逻辑已经被分开,XAML是SL的主要部 ...

  6. jQuery省市区三级联动菜单

    <style> select{ padding:5px 0; } .outer{ width:500px; margin:20px auto; } </style> <d ...

  7. 我的新书《Android App开发从入门到精通》终于出版啦

    前言 经过了两年多终于完成了这本书,2016年9月份开始写的,到今天为止2年零2个月,本书的内容大部分是去年完成的,看过我去年总结的读者可能知道,去年事情很多太忙了,导致本命年这本书没有上架(有点小小 ...

  8. 访问vsts私有nuget

    访问vsts私有nuget Intro 有时候我们可能要自己搭建一个 nuget,如果不对外公开,即包浏览也是需要权限的,那我们应该怎么做才可以支持在哪里都可以正常的还原包呢? 我是在 VSTS(Vi ...

  9. 在java中写出完美的单例模式

    1. 前言 单例(Singleton)应该是开发者们最熟悉的设计模式了,并且好像也是最容易实现的——基本上每个开发者都能够随手写出——但是,真的是这样吗? 作为一个Java开发者,也许你觉得自己对单例 ...

  10. electron入坑指南

    electron入坑指南 简介 electron 实际集成chrome浏览器和node环境, 运行你写的网页 app 基本目录结构 index.html 名称可以不是index, 这个文件与普通网页的 ...