# 專題頁面常用布局
~~~
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>城市頁面</title>
<link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/bootstrap-theme.min.css">
<link rel="stylesheet" href="./css/iconfont.css">
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/jquery.easing.min.js"></script>
<script src="js/jquery.mousewheel.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
html,body {
width: 100%;
height: 100%;
}
.swiper_container {
overflow: hidden;
width: 100%;
height: 100%;
}
.slide {
width: 100%;
}
.swiper_show {
width: 100%;
height: 100%;
position: relative;
top: 0;
left: 0;
}
.part1 {
background-image: url('./image/qb.png');
background-size: 100% 100%;
}
.part2 {
background: #fff;
}
.part3 {
background: yellow;
}
.part4 {
background: red;
}
.part5 {
background: blue;
}
.part6 {
background: green;
}
.part7 {
background: bisque;
}
.swiper_list {
position: fixed;
top: 50%;
left: 30px;
transform: translateY(-50%);
}
.swiper_dot {
display: block;
width: 15px;
height: 15px;
line-height: 15px;
text-align: center;
margin-bottom: 5px;
}
.swiper_dot span {
display: inline-block;
width: 8px;
height: 8px;
background-color: #000;
border-radius: 50%;
transition: all ease 0.5s;
}
.swiper_dot span:hover {
width: 10px;
height: 10px;
}
.swiper_dot.active span {
width: 12px;
height: 12px;
background-color: #fff;
}
.button_group {
position: fixed;
right: 0;
top: 50%;
transform: translateY(-50%);
}
.button .l-icon {
display: block;
width: 48px;
height: 48px;
text-align: center;
text-decoration: none;
line-height: 48px;
background-color: #909399;
font-size: 30px;
color: #fff;
}
.button {
margin: 2px 0;
position: relative;
display: block;
}
.button:hover {
text-decoration: none;
}
.button.active {
background-color: #000;
}
.l-qrcode {
position: absolute;
right: 48px;
bottom: 0;
}
.l-qrcode img {
width: 0;
height: 0;
transform-origin: right bottom;
transform: scale(0);
transition: all ease 0.5s;
}
.button[animate="show"]:hover .l-qrcode img {
width: 120px;
height: 120px;
transform: scale(1);
}
.l-info {
width: 74px;
position: absolute;
right: 58px;
top: 50%;
transform: translateY(-50%);
font-size: 16px;
text-align: center;
}
.l-info span {
display: block;
background-color: rgba(0,0,0, 0.6);
padding: 5px;
color: #fff;
border-radius: 5px;
visibility: hidden;
opacity: 0;
transition: all ease 0.5s;
position: relative;
}
.l-info span[trangle]::before {
content: '';
display: block;
position: absolute;
top: 50%;
right: -16px;
width: 0;
height: 0;
transform: translateY(-50%);
border-top: 8px solid transparent;
border-right: 8px solid transparent;
border-left: 8px solid rgba(0,0,0,0.6);
border-bottom: 8px solid transparent;
}
.button[animate="show"]:hover .l-info span{
opacity: 1;
visibility: visible;
}
.button[animate="top"] {
opacity: 0;
visibility: hidden;
}
</style>
</head>
<body>
<section class="swiper_container">
<div class="swiper_show">
<div class="slide part1"></div>
<div class="slide part2"></div>
<div class="slide part3"></div>
<div class="slide part4"></div>
<div class="slide part5"></div>
<div class="slide part6"></div>
<div class="slide part7"></div>
</div>
<!--輪播點-->
<div class="swiper_list">
<div data-index='0' class="swiper_dot"><span></span></div>
<div data-index="1" class="swiper_dot"><span></span></div>
<div data-index="2" class="swiper_dot"><span></span></div>
<div data-index="3" class="swiper_dot"><span></span></div>
<div data-index="4" class="swiper_dot"><span></span></div>
<div data-index="5" class="swiper_dot"><span></span></div>
<div data-index="6" class="swiper_dot"><span></span></div>
</div>
</section>
<div class="button_group">
<div animate="top" class="button">
<i class="l-icon iconfont icon-xiangshangjiantou"></i>
</div>
<a animate="show" class="button">
<i class="l-icon iconfont icon-liaotian"></i>
<div class="l-info">
<span trangle>免費咨詢</span>
</div>
</a>
<div animate="show" class="button">
<i class="l-icon iconfont icon-erweima"></i>
<div class="l-qrcode">
<img src="./image/qrcode.jpg" alt="">
</div>
</div>
</div>
</body>
<script>
let FullPage = function () {
// 初始化參數變量
let $height = this.$height = $('.swiper_container').height()
let slide= $('.slide')
slide.css({'height': $height})
let len = slide.length
$('.swiper_show').css({"height": len * 974})
// 內置對象
let Scroll = function () {
}
// 頁面翻滾函數
Scroll.prototype.start = function ($index, $height) {
let offset = -$index * $height
$(".swiper_show").queue('scroll', function (next) {
$(this).animate({"top": offset+"px"}, 500, function () {
FullPage.$tottle = true
})
next()
})
$('.swiper_show').dequeue('scroll')
}
// 檢測$index函數
Scroll.prototype.isRightIndex = function ($index) {
if($index < FullPage.$min) {
return FullPage.$min;
}
if ($index > FullPage.$max) {
return FullPage.$max;
}
// 記錄$index
FullPage.$index = $index
return $index
}
// 回到頂部
Scroll.prototype.scrollTop = function (scroll, flag) {
if (flag === 0) {
FullPage.$index = 0
scroll.start(0, $height)
console.log($('[animate="top"]'))
$('[animate="top"]').queue('scrollTop',function (next) {
$(this).animate({'opacity': 0}, {
complete: function () {
$(this).css({'visibility': 'hidden'})
}
})
next()
}).dequeue('scrollTop')
} else {
$('[animate="top"]').queue('scrollTop',function (next) {
$(this).css({'visibility': 'visible'}).animate({'opacity': 1})
next()
}).dequeue('scrollTop')
}
}
// 輪播點圖動畫效果
Scroll.prototype.dotChange = function ($index) {
$('.swiper_dot').removeClass('active')
$($('.swiper_dot')[$index]).addClass('active')
}
let scroll = new Scroll()
$('[animate="top"]').on('click', function () {
scroll.scrollTop(scroll, 0)
})
// 綁定輪播事件
this.init = function () {
$('.swiper_show').mousewheel(function (event, delta) {
let $index = FullPage.$index
if(FullPage.$tottle) {
FullPage.$tottle = false
if(delta< 0) {
// 向下翻滾
$index++
$index = scroll.isRightIndex($index)
scroll.start($index, $height)
scroll.scrollTop(scroll, $index)
scroll.dotChange($index)
}
if(delta > 0) {
// 向上翻滾
$index--
$index = scroll.isRightIndex($index)
scroll.start($index, $height)
scroll.scrollTop(scroll, $index)
scroll.dotChange($index)
}
}
})
}
this.init()
}
// 對象全局變量
FullPage.$index = 0
FullPage.$tottle = true
FullPage.$max = 6
FullPage.$min = 0
new FullPage()
</script>
</html>
~~~
- 前端
- pc端
- 京東無延時菜單效果
- datapicker組件的編寫
- cursor禁止默認樣式
- 移動端
- web在真機調試
- 有關vue的上拉加載
- 下拉刷新
- vue獲取dom節點
- worker技術
- h5頁面喚醒手機撥號,發短信功能
- 彈出層喚醒擠壓css背景圖片
- 23模式
- 基礎模式
- SMD同步模塊
- canvas
- 點的均勻分布
- 線條繪畫
- canvas常見的全局屬性
- 判斷點在某個區間內
- 保證動畫效果的流暢性
- arc函數學習
- cookies
- 本地服務搭建
- Mint UI框架的學習
- 第一天
- Swiper組件的解析
- loadmore組件
- 二維碼的生成
- 前端優化
- 瀏覽器緩存
- indexdb本地數據庫的使用
- 淺談前端優化
- css漸變屬性
- 前端常用組件學習
- picker組件
- vue
- 模塊下的state訪問
- vue的進階
- npm包的發布
- 淘寶移動端適配問題
- vue的生命周期的理解
- vue的路由學習
- vue自帶的動畫效果
- vue 項目里,img標簽報錯,添加默認圖片
- axios 實現loading加載提示
- qs庫
- vue的v-for指令無法使用在tr、td中
- vue打包之后,npm run dev 空白
- vue 單頁面百度統計
- unix時間轉化
- UI組件的實現
- picker
- upload組件
- js動畫效果
- canvas甜甜圈的編寫
- 瀑布流實現
- 適配問題
- 圖片加載
- js基礎知識
- js數組合并
- 響應布局總結
- 組件開發
- grid組件
- 專題頁面常用布局頁面
- scroll滾動問題
- 項目整理經驗收集
- 畫圖工具應用實現記錄
- 參考線實現
- JCode
- 多條件篩選不用ajax的原因分析
- node
- koa路由下的分塊
- 連接數據庫mysql
- 初步搭建數據庫模型
- java
- spring框架的學習
- maven 搭建web項目
- 建站
- 關聯github
- 雜文
- 后端常用成熟系統
- node實戰練習
- 編寫郵箱通知
- 微信小程序
- 模板之坑
- 模板坑之數據傳入
- 小程序組件化之一
- 有關this的綁定
- 小程序組件化之二
- 小程序分包加載
- tab切換,頁面狀態不更新
- 小程序請求組件(草稿)
- php學習之路
- 文件上傳
- 有關數據庫時間類型的插入
- Ubuntu下的php開啟擴展模塊
- windows系統下的hosts文件位置
- 騰訊云的cos
- thinkPHP
- 模塊設計
- 模型的使用
- ajax的請求異常總結
- apache服務器
- 虛擬主機的建立
- ssh的使用
- ftp服務器配置
- Lamp的搭建
- ftp從零開始配置
- https的配置
- git hooks實現簡單的自動部署
- ubuntu系統登錄遠程ubuntu服務器
- ubuntu
- 新建用戶需要使用sudo
- sftp的文件上傳問題
- 配置apache部分問題總結
- git服務器的搭建
- githook的學習
- ubuntu 虛擬主機搭建
- ubunut的服務器的防火墻的關閉
- 寶塔部署laravel
- 關于寶塔phpmyadmin無法訪問的問題
- 解決碼云每次提交輸入密碼的問題
- mysql
- phpmyadmin的安裝
- 遠程登陸數據庫
- git的使用
- 拉去分支的代碼
- git remote指令
- 學習臨時筆記
- ios兼容性問題
- 蘋果獲取屏幕寬度問題
- toDataURL無法導出圖片
- 蘋果觸屏滾動,下拉刷新問題
- jquery動畫
- jquery的animate無法使用transform
- jquery隊列queue
- css重學之路
- 規范一
- css3的matrix屬性
- 淘寶適配方案
- Yii框架學習
- gd庫的支持安裝
- larval框架學習
- 中間件
- 指令
- 自定義指令生成token
- 微信登錄后端篇
- 寶塔apache配置ssl
- SVN
- PS
- 快捷鍵
- Redis
- Redis在Unbtun下的配置
- 微信公眾號開發
- 測試號配置