作者:沙鹰之眼 | 来源:互联网 | 2023-05-17 22:03
fullpagejs实现的拥有header和foooter的全屏滚动,技术要点:给section元素加fp-auto-height类,<!DOCTYPEhtml><htmllan
fullpagejs实现的拥有header和foooter的全屏滚动,
技术要点:给section元素加fp-auto-height类,
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>fullpage footertitle>
<link href="https://cdn.bootcss.com/fullPage.js/2.9.5/jquery.fullpage.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js">script>
<script src="https://cdn.bootcss.com/fullPage.js/2.9.5/jquery.fullpage.js">script>
<style>
.section {
text-align: center;
font: 30px "Microsoft Yahei";
color: #fff;
}
.header, .footer {
height: 100px;
}
style>
<script>
$(function () {
$('#stumpx').fullpage({
sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', '#f90']
});
});
script>
head>
<body>
<div id="stumpx">
<div class="section fp-auto-height header">
<h3>第一屏 headerh3>
div>
<div class="section">
<h3>第二屏h3>
div>
<div class="section">
<h3>第三屏h3>
div>
<div class="section fp-auto-height footer">
<h3>第四屏 footerh3>
div>
div>
body>
html>