手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >jQuery实现类似滑动门切换效果的层切换
jQuery实现类似滑动门切换效果的层切换
摘要:复制代码代码如下:滑动门切换,jQuery层切换代码$(function(){$("ulli").each(function(i){$(th...

复制代码 代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>滑动门切换,jQuery层切换代码</title>

<script type="text/javascript" src="http://www.jb51.net/ajaxjs/jquery-1.6.2.min.js"></script>

<script type="text/javascript">

$(function(){

$("ul li").each(function(i){

$(this).hover(function(){

$(this).addClass("bg").siblings().removeClass("bg");

$(".div:eq("+i+")").show().siblings(".div").hide();

})

})

})

</script>

<style type="text/css">

*{ margin:0; padding:0; font-size:12px;}

ul li{ list-style:none; float:left; background-color:#999; cursor:pointer; width:100px; height:25px; line-height:25px; text-align:center;}

ul li.bg{ background-color:#9F0;}

.clr{ clear:both;}

.div{width:200px; height:60px; background:#666; line-height:60px; text-align:center;}

.none{ display:none}

</style>

</head>

<body>

<ul><li>账户信息</li><li>邮寄地址</li></ul>

<div></div>

<div>

第一个div内容

</div>

<div>

第二个div内容

</div>

</body>

</html>

【jQuery实现类似滑动门切换效果的层切换】相关文章:

jQuery实现返回顶部效果的方法

JS+DIV实现鼠标划过切换层效果的方法

javascript实现树形菜单的方法

jQuery实现将页面上HTML标签换成另外标签的方法

JS+CSS实现的拖动分页效果实例

jQuery实现首页图片淡入淡出效果的方法

jQuery实现表格行上移下移和置顶的方法

Javascript实现div层渐隐效果的方法

JavaScript实现点击文字切换登录窗口的方法

jQuery实现弹出窗口中切换登录与注册表单

精品推荐
分类导航