jquery特效-全屏楼梯式滚动
2016-06-29 13:35
543 查看
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> 全屏楼梯式滚动特效-小猪 </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<style type="text/css">
*{margin:0px; padding:0px;}
body{background:url('img/bg.jpg')}
.nav{width:164px; position:fixed; top:200px; left:50px;}
.nav img:hover{cursor:pointer;}
.nav ul.navCon{width:110px; height:190px; background:#943ec9; margin:0 auto; display:none;}
.nav ul li{width:100%; height:35px; list-style-type:none; color:#ddd; font-size:14px; font-family:"微软雅黑"; text-align:center; line-height:35px; cursor:pointer; background:url('img/bg1.png') no-repeat bottom;}
.nav ul li:hover{color:#fff;}
.con{width:100%; height:100%; position:fixed; left:0px; top:0px; z-index:-1;}
.con ul{width:100%; height:100%;}
.con ul li{width:100%; height:100%;}
</style>
</head>
<body>
<!--导航栏开始-->
<div class="nav">
<img src="img/index.png" />
<ul class="navCon">
<li>意时网</li>
<li>谋福利</li>
<li>免费保险</li>
<li>手机应用</li>
<li>意时广告</li>
</ul>
</div>
<!--导航栏结束-->
<!--内容部分开始-->
<div class="con">
<ul>
<li style="background:url('img/guangGao.png') no-repeat center;"></li>
<li style="background:url('img/MAP.png') no-repeat center;"></li>
<li style="background:url('img/pic_about.png') no-repeat center;"></li>
<li style="background:url('img/pic_culture.png') no-repeat center;"></li>
<li style="background:url('img/pic_joinus.png') no-repeat center;"></li>
</ul>
</div>
<!--内容部分开始-->
<!--引入jquery库-->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
//点击飞艇图片时触发
$(".nav img").click(function(e){
$(".nav ul.navCon").slideToggle("slow");
e.stopPropagation();
});
//点击屏幕其他地方时触发
$(window).click(function(){
$(".nav ul.navCon").slideToggle("slow");
});
//点击导航栏的菜单时触发
$(".nav ul li").click(function(){
//获取点击的ul下的li的索引值
var index = $(this).index();
//alert(index);
//获取浏览器的高度
var height = $(window).height();
//alert(height);
//点击导航栏中的ul下的li时,切换到对应的图片
$(".con").animate({"top" : -height*index}, 500);
});
</script>
</body>
</html>
效果图如下(当鼠标点击飞艇时显示导航条菜单信息):
<html>
<head>
<title> 全屏楼梯式滚动特效-小猪 </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<style type="text/css">
*{margin:0px; padding:0px;}
body{background:url('img/bg.jpg')}
.nav{width:164px; position:fixed; top:200px; left:50px;}
.nav img:hover{cursor:pointer;}
.nav ul.navCon{width:110px; height:190px; background:#943ec9; margin:0 auto; display:none;}
.nav ul li{width:100%; height:35px; list-style-type:none; color:#ddd; font-size:14px; font-family:"微软雅黑"; text-align:center; line-height:35px; cursor:pointer; background:url('img/bg1.png') no-repeat bottom;}
.nav ul li:hover{color:#fff;}
.con{width:100%; height:100%; position:fixed; left:0px; top:0px; z-index:-1;}
.con ul{width:100%; height:100%;}
.con ul li{width:100%; height:100%;}
</style>
</head>
<body>
<!--导航栏开始-->
<div class="nav">
<img src="img/index.png" />
<ul class="navCon">
<li>意时网</li>
<li>谋福利</li>
<li>免费保险</li>
<li>手机应用</li>
<li>意时广告</li>
</ul>
</div>
<!--导航栏结束-->
<!--内容部分开始-->
<div class="con">
<ul>
<li style="background:url('img/guangGao.png') no-repeat center;"></li>
<li style="background:url('img/MAP.png') no-repeat center;"></li>
<li style="background:url('img/pic_about.png') no-repeat center;"></li>
<li style="background:url('img/pic_culture.png') no-repeat center;"></li>
<li style="background:url('img/pic_joinus.png') no-repeat center;"></li>
</ul>
</div>
<!--内容部分开始-->
<!--引入jquery库-->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
//点击飞艇图片时触发
$(".nav img").click(function(e){
$(".nav ul.navCon").slideToggle("slow");
e.stopPropagation();
});
//点击屏幕其他地方时触发
$(window).click(function(){
$(".nav ul.navCon").slideToggle("slow");
});
//点击导航栏的菜单时触发
$(".nav ul li").click(function(){
//获取点击的ul下的li的索引值
var index = $(this).index();
//alert(index);
//获取浏览器的高度
var height = $(window).height();
//alert(height);
//点击导航栏中的ul下的li时,切换到对应的图片
$(".con").animate({"top" : -height*index}, 500);
});
</script>
</body>
</html>
效果图如下(当鼠标点击飞艇时显示导航条菜单信息):
相关文章推荐
- Dojo与jQuery的选择~
- jquery滚动条滚动的指定位置
- jquery在选择元素的时候,可以写成var div=$("div")
- 使用jquery.qrcode生成二维码及常见问题解决方案
- jquery select取值,赋值操作
- jquery方式的价格随数量增加、删除当前行与所有行
- 二维码在线生成工具
- Jquery开发插件的方法
- jquery Array Map的使用
- jquery获取项目的路径
- 记录jQuery的一些用法
- JQuery
- jQuery.bsgrid
- jquery datatable 水平滚动条
- jQuery基础学习(2)(效果)
- [从jQuery看JavaScript]-匿名函数与闭包(Anonymous Function and Closure)
- [jQuery]操作具有父子关系的复选框
- jQuery EasyUI使用教程之树的拖放控制
- jQuery修改标签的text显示内容或value值
- jQuery Validate多实例讲解