浅谈jquery fullpage 插件增加头部和版权的方法
2018-03-20 09:17
711 查看
一个页面,我们通过 jquery-fullpage 插件来制作,整个是全屏滚动的。但是,我们希望在最后一页增加一个版权,大概只有 100px 高,而不需要一个全屏来放版权。怎么做呢?搜索了一下,说了各种方法。什么修改源码啦之类的,或者自己写代码判断啦。晕死。其实,官方给出了解决方案。
下面,我们简单的说下是怎么实现的
实现其实只需要 html 部分
<div class="fullpage"> <div class="section fp-auto-height">这里写头部</div> <div class="section">page1</div> <div class="section">page2</div> <div class="section">page3</div> <div class="section">page4</div> <div class="section fp-auto-height">这里写版权</div> </div>
如上,js代码就不说了,只要你能跑起来,就没有问题。这里只需要给头部和底部增加一个fp-auto-height 的 class 即可。
没有生效吗?
嘿嘿,那是因为你只引用了js,而没有引用css造成的,只要引用下面的css即可。
https://github.com/alvarotrigo/fullPage.js/blob/master/dist/jquery.fullpage.css
其实关键代码只是下面的而已
.fp-auto-height.fp-section, .fp-auto-height .fp-slide, .fp-auto-height .fp-tableCell{ height: auto !important; } .fp-responsive .fp-auto-height-responsive.fp-section, .fp-responsive .fp-auto-height-responsive .fp-slide, .fp-responsive .fp-auto-height-responsive .fp-tableCell { height: auto !important; }
小结
你的问题可能早就被人遇到了,一定有人给你解决过的。善于利用搜索引擎即可。
以上这篇浅谈jquery fullpage 插件增加头部和版权的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- jquery fullpage 插件增加头部和版权的方法
- jquery.fullPage.js全屏滚动插件的使用方法
- jQuery-全屏滚动插件【fullPage.js】API 使用方法总结
- jQuery-全屏滚动插件【fullPage.js】API 使用方法总结
- jQuery全屏滚动插件FullPage.js
- jQuery全屏滚动插件fullPage.js演示
- 给jquery的validate插件增加自定义方法
- jQuery全屏滚动插件fullPage.js API
- jQuery全屏滚动插件fullPage.js
- jquery-fullpage-js制作页全屏滚动插件
- jquery-fullpage插件
- 【收藏】介绍一款jQuery插件:Fullpage.js
- fullpage(jQuery全屏滚动插件)插件的使用
- jQuery全屏滚动插件FullPage.js中文帮助文档API
- 【jQuery插件】-----全屏插件fullpage
- 基于JQuery实现仿网易邮箱全屏动感滚动插件fullPage
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js
- jQuery全屏滚动插件fullPage.js使用中遇到的问题(滑动轮播效果无效)