jquery楼层滚动特效
来源:互联网 发布:淘宝网新店有支持吗 编辑:程序博客网 时间:2024/04/29 02:28
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>jq 楼层滚动效果</title> <style> * { margin: 0; padding: 0; } i { font-style: normal; } ul, li, dl, ol{ list-style: none; } #LoutiNav { border: 1px solid gray; width: 30px; position: fixed; top: 150px; left: 50px; display: none; } #LoutiNav li { width: 30px; height: 30px; border-bottom: 1px solid gray; line-height: 30px; text-align: center; cursor: pointer; } #LoutiNav span { display: none; } #LoutiNav .active { background: white; color: darkred; } #LoutiNav li:hover span { display: block; font-size: 12px; background: darkred; color: white; } #LoutiNav li:hover i { display: none; } #goTop { width: 40px; height: 40px; line-height: 40px; text-align: center; background: gray; position: fixed; bottom: 30px; right: 30px; cursor: pointer; border-radius: 5px; display: none; } #goTop:hover { background: darkred; color: white; } #goTop:hover span { display: block; } #erweima { width: 130px; height: 130px; background: palegreen; display: none; position: absolute; right: 46px; bottom: 5px; line-height: 130px; text-align: center; font-size: 20px; border-radius: 10px; } #header { height: 200px; background: palegoldenrod; text-align: center; line-height: 200px; font-size: 72px; margin: 0 auto; } .louceng { height: 810px; text-align: center; line-height: 610px; font-size: 120px; margin: 0 auto; } </style> <script src="js/jquery-1.7.2.min.js"></script> </head> <body> <ul id="LoutiNav"> <li class="active"><i>1F</i><span>服饰</span></li> <li><i>2F</i><span>美妆</span></li> <li><i>3F</i><span>手机</span></li> <li style="border-bottom: none;"><i>4F</i><span>家电</span></li> </ul> <div id="goTop"> <span id="erweima">我是二维码</span> Top </div> <div id="header">头部</div> <div id="main"> <div class="louceng" style="background: papayawhip;">服饰</div> <div class="louceng" style="background: peachpuff;">美妆</div> <div class="louceng" style="background: peru;">手机</div> <div class="louceng" style="background: pink;">家电</div> </div> <script> var oNav = $('#LoutiNav'); //导航壳 var aNav = oNav.find('li'); //导航 var aDiv = $('#main .louceng'); //楼层 var oTop = $('#goTop'); //回到顶部 $(window).scroll(function() { //可视窗口高度 var winH = $(window).height(); //鼠标滚动的距离 var iTop = $(window).scrollTop(); if(iTop >= $("#header").height()) { oNav.fadeIn(); oTop.fadeIn(); //鼠标滑动样式改变 aDiv.each(function() { if(winH + iTop - $(this).offset().top > winH / 2) { aNav.removeClass('active'); aNav.eq($(this).index()).addClass('active'); } }) } else { oNav.fadeOut(); oTop.fadeOut(); } }) //点击回到当前楼层 aNav.click(function() { var t = aDiv.eq($(this).index()).offset().top; $('body,html').animate({ "scrollTop": t }, 500); $(this).addClass('active').siblings().removeClass('active'); }); //回到顶部 oTop.click(function() { $('body,html').animate({ "scrollTop": 0 }, 500) }) </script> </body></html>
0 0
- jquery楼层滚动特效
- jquery 特效 字体滚动
- jquery 滚动特效
- jequery特效楼层
- JQUERY 无隙滚动特效
- 楼层滚动(JQ)
- jquery精确楼层定位
- jquery仿京东楼层效果
- jquery楼层效果
- Jquery特效三:多行滚动显示
- jquery特效:无缝向上循环滚动列表
- 利用JQuery实现广告动态滚动特效
- jquery特效-全屏楼梯式滚动
- jquery---组件高效的数字滚动特效
- JQuery 公告滚动(跑马灯特效)
- 京东楼层右侧滚动楼层显示code
- 图片左右间隔滚动Jquery特效,点击滚动,不点击自动滚动 jquery
- msclass实例 jquery 通用滚动特效,文字单行,多行停留滚动,图文上下左右滚动
- 二叉树的遍历
- java根据出生日期计算年龄
- 深入理解Session和 Cookie
- linux下nohup日志切割方案
- HDU 3706 Second My Problem First 单调队列简单题
- jquery楼层滚动特效
- 函数重载和函数指针在一起
- (HDU 5726)GCD <RMQ + map + 二分> 多校训练1
- Matlab中set-gca函数的使用
- Redis 在 Win7 64bit + VS2013 使用
- Mysql常用命令(一)
- 关于备忘录解决二次项问题
- Android 接入微信支付宝支付
- spark 存储json数据遇到问题——json4s使用(二)