博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
模拟凡客导航
阅读量:5024 次
发布时间:2019-06-12

本文共 4340 字,大约阅读时间需要 14 分钟。

<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title></title>
<style type="text/css">
#div1{ width:260px; height:120px; padding:10px;}
.inner{float:left; width:100px; height:100px; background-color:#f00; }
.right_div{float:left; display:none; width:150px; height:100px; margin-left:10px; background-color:#999;}
</style>
<script type="text/javascript">
function goshow(){
var wa=document.getElementById("div1");
var wa2=document.getElementById("div2");
wa.style.backgroundColor="black";
wa2.style.display="block";
//wa.style.display="none";
wa.style.width="258px;";
wa.style.height="118px;";
wa.style.border="thick solid #0000FF";
};
function goback(){
var wa=document.getElementById("div1");
var wa2=document.getElementById("div2");
wa.style.backgroundColor="red";
wa2.style.display="none";
//wa.style.display="none";
wa.style.width="258px;";
wa.style.height="118px;";
wa.style.border="thick solid #999";
};
</script>
</head>
<body>
<div id="div1">
<div class="inner" οnmοuseοver="goshow()" οnmοuseοut="goback()"></div>
<div class="right_div" id="div2"></div>
</div>
</body>
</html> -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title></title>
<style type="text/css">
* {
padding: 0px;
margin: 0px;
}
ul {
list-style: none;
}
.big_wrapper {
position: relative;
width: 400px;
}
#tips {
width: 150px;
height: 30px;
line-height: 30px;
color: #fff;
background-color: #CC2222;
text-align: center;
cursor: pointer;
}
.pro_list {
width: 150px;
left: 0px;
position: absolute;
}
.pro_list li {
width: 150px;
height: 24px;
line-height: 24px;
background-color: #E84848;
text-align: center;
}
.pro_list li.active {
background-color: #f00;
}
.pro_list li a {
color: #fff;
}
#content {
width: 200px;
left: 150px;
position: absolute;
background-color: #f00;
}
#content dl {
width: 200px;
height: 400px;
display: none;
}
#content dl dd {
width: 200px;
height: 400px;
display: none;
}
</style>
</head>
<body>
<div id="tips">全部产品</div>
<div class="big_wrapper">
<div class="pro_list" id="pro_list" style="display:block">
<ul id="list">
<li><a href="">男性用品</a></li>
<li><a href="">女性用品</a></li>
<li><a href="">老年用品</a></li>
<li><a href="">儿童用品</a></li>
<li><a href="">青少年用品</a></li>
<li><a href="">人妖</a></li>
</ul>
</div>
<div id="content">
<dl>
<dt>1</dt>
<dd>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</dd>
</dl>
<dl>
<dt>2</dt>
<dd>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</dd>
</dl>
<dl>
<dt>3</dt>
<dd>cccccccccccccccccccccccccccccccccccccccccc</dd>
</dl>
<dl>
<dt>4</dt>
<dd>dddddddddddddddddddddddddddddddddddddddddd</dd>
</dl>
<dl>
<dt>5</dt>
<dd>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee</dd>
</dl>
<dl>
<dt>6</dt>
<dd>ffffffffffffffffffffffffffffffffffffffffff</dd>
</dl>
</div>
</div>
<script type="text/javascript">
window.onload = function() {
var ontips = document.getElementById('tips');
var s_c2 = document.getElementById('list');
var sc_li = s_c2.getElementsByTagName('li');
var b_c = document.getElementById('content');
var bc_li = b_c.getElementsByTagName('dl');
var i = 0;
var timer = null;

for (i = 0; i < sc_li.length; i++) {

sc_li[i].index = i;

sc_li[i].onmouseover = function() {
if (timer) {
clearTimeout(timer);
timer = null;
}
for (i = 0; i < sc_li.length; i++) {
sc_li[i].className = '';
bc_li[i].style.display = 'none';
}
sc_li[this.index].className = 'active';
bc_li[this.index].style.display = 'block';

};

sc_li[i].onmouseout = function() {

var index = this.index;
timer = setTimeout(function() {
sc_li[index].className = '';
bc_li[index].style.display = 'none';
timer = null;
},
1000);
};

bc_li[i].index = i;

bc_li[i].onmouseover = function() {
if (timer) {
clearTimeout(timer);
timer = null;
}
};

bc_li[i].onmouseout = function() {

var index = this.index;
timer = setTimeout(function() {
sc_li[index].className = '';
bc_li[index].style.display = 'none';
timer = null;
},
1000);
};

ontips.onclick = function() {

if (s_c.style.display == 'block') {
s_c.style.display = 'none';
} else {
s_c.style.display = 'block';
}
}

}

}

</script>
</body>
</html>

转载于:https://www.cnblogs.com/woohblog/archive/2013/05/31/3110155.html

你可能感兴趣的文章
jquery基本选择器
查看>>
hdu 1010 dfs搜索
查看>>
搭建wamp环境,数据库基础知识
查看>>
android中DatePicker和TimePicker的使用
查看>>
SpringMVC源码剖析(四)- DispatcherServlet请求转发的实现
查看>>
Android中获取应用程序(包)的大小-----PackageManager的使用(二)
查看>>
Codeforces Gym 100513M M. Variable Shadowing 暴力
查看>>
浅谈 Mybatis中的 ${ } 和 #{ }的区别
查看>>
CNN 笔记
查看>>
版本更新
查看>>
SQL 单引号转义
查看>>
start
查看>>
实现手机扫描二维码页面登录,类似web微信-第三篇,手机客户端
查看>>
PHP socket客户端长连接
查看>>
7、shell函数
查看>>
【转】Apache Jmeter发送post请求
查看>>
Nginx 基本 安装..
查看>>
【凸优化】保留凸性的几个方式(交集、仿射变换、投影、线性分式变换)
查看>>
NYOJ-613//HDU-1176-免费馅饼,数字三角形的兄弟~~
查看>>
TFS --- GrantBackup Plan Permissions Error
查看>>