像京东商城 商品页面 的 鼠标放上去就自动展开的菜单怎么做啊 css 和javascript 都可以

像京东商城商品页面的鼠标放上去就自动展开的菜单怎么做啊css和javascript都可以谢谢!具体要怎么加能告诉我吗?我javascript也不熟... 像京东商城 商品页面 的 鼠标放上去就自动展开的菜单怎么做啊 css 和javascript 都可以
谢谢!具体要怎么加能告诉我吗? 我javascript也不熟
展开
 我来答
lp5276159be1
2011-01-10 · TA获得超过2万个赞
知道大有可为答主
回答量:1万
采纳率:39%
帮助的人:4318万
展开全部
给你一个类似的,需要展开的菜单你加一个样式默认隐藏,然后在JS里加一个事件显示就好了

<!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=gb2312" />
<title>CSS+XHTML代码</title>
</head>
<style type="text/css">
/* ================================================================
This copyright notice must be untouched at all times.

The original version of this stylesheet and the associated (x)html
is available at http://www.cssplay.co.uk/menus/page_menu2.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any
way to fit your requirements.

=================================================================== */
body {
background: #fff;
font-family: "Lucida Grande", Helvetica, Arial, sans-serif;
font-size: 12px;
}
#hoverpage ul#outer li div p {font-size:12px; line-height:16px; margin:5px 0 15px 0;}
#hoverpage ul#outer li div h2 {line-height:1em; color:#585; font-size:1.5em; font-weight:normal; margin-top:0; font-family:verdana, sans-serif;}
#hoverpage ul#outer li div h3 {line-height:1em; color:#66a; font-size:1.2em; font-weight:normal; margin-top:0;}
#hoverpage ul#outer li div h3.clear {clear:left;}

#hoverpage {width:650px; height:450px; border:1px solid #aaa; background:#fff; position:relative; z-index:500; overflow:hidden; text-align:left;}
#hoverpage table {border-collapse:collapse; margin:-1px;}
#hoverpage ul#outer {background:transparent; padding:0; margin:0;list-style:none;}

#hoverpage ul#outer li.page {display:inline;} /* needed for IE to function correctly */

#hoverpage ul#outer li.page a.menuitem {text-decoration:none;}

#hoverpage ul#outer li.page i {position:absolute; display:block; height:25px; right:500px; background:transparent; cursor:default; z-index:100; text-align:right; text-decoration:none; color:#080; font-style:normal; cursor:pointer;}

#hoverpage ul#outer li.p1 i {top:30px;}
#hoverpage ul#outer li.p2 i {top:55px;}
#hoverpage ul#outer li.p3 i {top:80px;}
#hoverpage ul#outer li.p4 i {top:105px;}
#hoverpage ul#outer li.p5 i {top:130px;}

#hoverpage ul#outer li.page div {display:block; width:600px; height:400px; padding:25px; font-weight:normal; color:#444;}
#hoverpage ul#outer li.p1 div {background:#fff url(page1_back.jpg);}
#hoverpage ul#outer li.p2 div {background:#fff url(page2_back.jpg);}
#hoverpage ul#outer li.p3 div {background:#fff url(page3_back.jpg);}
#hoverpage ul#outer li.p4 div {background:#fff url(page4_back.jpg);}
#hoverpage ul#outer li.p5 div {background:#fff url(page5_back.jpg);}

#hoverpage ul#outer li div img {border:1px solid #888; float:right; margin:0 10px 5px 0;}
#hoverpage ul#outer li div p.big {line-height:1em; color:#004; font-size:1.5em;}
#hoverpage ul#outer li div a {color:#00c; text-decoration:underline;}
#hoverpage ul#outer li div em {display:block; width:190px; height:230px; float:left; background:transparent url(current.gif) no-repeat; margin-right:10px;}

#hoverpage ul#outer li.p1 div em {background-position: 21px 0;}
#hoverpage ul#outer li.p2 div em {background-position: 21px 25px;}
#hoverpage ul#outer li.p3 div em {background-position: 21px 50px;}
#hoverpage ul#outer li.p4 div em {background-position: 21px 75px;}
#hoverpage ul#outer li.p5 div em {background-position: 21px 100px;}

#hoverpage ul#outer li.page div a:hover {text-decoration:none;}

#hoverpage ul#outer li.page a:hover {white-space:normal;} /* for IE6 */

#hoverpage ul#outer :hover div {position:absolute; left:0; top:0;}
#hoverpage ul#outer a:hover i {color:#66a; font-weight:bold;} /* for IE6 */
#hoverpage ul#outer :hover a i {color:#66a; font-weight:bold;}

#hoverpage ul#outer div ul li {line-height:20px; font-size:0.9em; color:#256; list-style-type:disc;}
#hoverpage ul#outer div ul li a {line-height:20px; font-size:1.1em; color:#c00;}

#hoverpage ul#outer div dl dd {line-height:20px; font-size:1.1em; color:#448;}
#hoverpage ul#outer div dl dt {line-height:30px; font-size:1.3em; color:#333;}

</style>
<body>
<div id="hoverpage">

<ul id="outer">
<li class="page p1"><a href="#nogo" class="menuitem"><i>Products</i><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div>
<em></em>
<img src="bags.jpg" alt="" />
<h2>Products</h2>
<h3>Lorem Ipsum</h3>
<ul>
<li><a href="#nogo1">Integer nonummy neque.</a></li>
<li><a href="#nogo1">Aliquam accumsan.</a></li>
<li><a href="#nogo1">Nulla in sapien eget eros.</a></li>
<li><a href="#nogo1">Nam varius ante et risus.</a></li>
<li><a href="#nogo1">Phasellus at erat id metus.</a></li>
<li><a href="#nogo1">Donec malesuada ultricies.</a></li>
<li><a href="#nogo1">Duis quis purus sit amet.</a></li>
<li><a href="#nogo1">Morbi porta dapibus enim.</a></li>
</ul>
<h3 class="clear">Product Information</h3>
<p>Suspendisse potenti. Donec viverra molestie enim. Fusce fermentum, erat id cursus aliquam, mauris augue volutpat dolor, in interdum purus pede dictum diam. Morbi interdum diam at ligula. Morbi laoreet. Morbi mollis tristique justo. Etiam accumsan fermentum ipsum. Phasellus vestibulum, leo in dapibus ultricies, nisi nulla fermentum tortor, eu lobortis nibh urna ac dui. Aliquam erat volutpat. Curabitur vitae sapien sed libero dictum pellentesque. Praesent quis enim nec tellus congue hendrerit. Ut tellus. Morbi rhoncus elit lobortis libero.</p>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li class="page p2"><a href="#nogo" class="menuitem"><i>Services</i><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div>
<em></em>
<img src="service.jpg" alt="" />
<h2>Services</h2>
<h3>Curabitur eget</h3>
<ul>
<li><a href="#nogo2">Suspendisse potenti.</a><br />Quisque at ante nec lacus cursus malesuada.</li>
<li><a href="#nogo2">Donec viverra molestie enim.</a><br />Sed ac tortor nec augue hendrerit pulvinar.</li>
<li><a href="#nogo2">Pellentesque habitant.</a><br />Nullam rhoncus hendrerit orci.</li>
<li><a href="#nogo2">Vivamus non turpis.</a><br />Sed lacinia egestas mi.</li>
</ul>
<h3 class="clear">Available Services</h3>
<p>Proin scelerisque justo quis ante. Maecenas vehicula orci quis arcu. Nam dictum lectus quis ipsum. In felis. Cras eu lectus. Nam sed est ut orci venenatis faucibus. Ut molestie massa non massa. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Curabitur eget magna a odio vestibulum laoreet. Vivamus faucibus tincidunt massa. Sed a nunc. Quisque varius sagittis libero.</p>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li class="page p3"><a href="#nogo" class="menuitem"><i>Latest Information</i><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div>
<em></em>
<img src="news.jpg" alt="" />
<h2>Latest Information</h2>
<h3>Fusce fermentum</h3>
<ul>
<li><a href="#nogo3">Donec posuere enim a sapien.<br />Malesuada fames ac turpis egestas.</a></li>
<li>Vivamus dignissim tincidunt quam.</li>
<li>Nullam varius vestibulum mauris.</li>
<li>Curabitur faucibus varius dui.<br /><a href="#nogo3">Cras suscipit viverra felis. Nullam diam.</a></li>
<li>Vivamus convallis volutpat nunc.</li>
<li>Sed porttitor dui vel nunc.</li>
</ul>
<h3 class="clear">Latest Product Information</h3>
<p>Nam porttitor congue diam. Donec in mi. Fusce ac neque. Donec quis justo. Nunc non justo quis augue sagittis volutpat. Etiam quis ligula commodo augue tempus pulvinar. Morbi ante arcu, aliquam ut, consequat et, consequat sed, sem. Cras suscipit viverra felis. Nullam diam. Duis eros purus, ornare sit amet, viverra sed, laoreet ac, pede.</p>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li class="page p4"><a href="#nogo" class="menuitem"><i>Press Release</i><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div>
<em></em>
<img src="press.jpg" alt="" />
<h2>Press Release</h2>
<h3>Quisque varius</h3>
<dl>
<dt>11th June 2007</dt>
<dd>In feugiat scelerisque pede.</dd>
<dd>Morbi iaculis eleifend ante.</dd>
<dd>Maecenas fringilla scelerisque erat.</dd>
<dd>Nam <a href="nogo5">accumsan</a> egestas eros.</dd>
</dl>
<h3 class="clear">News and Information</h3>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse vitae sem. <a href="nogo5">Class aptent taciti</a> sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Donec ut nunc. <a href="nogo5">In dictum, dui nec vehicula vehicula</a>, neque leo faucibus est, porta vehicula nisi odio eu tellus.</p>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li class="page p5"><a href="#nogo" class="menuitem"><i>Contact us</i><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div>
<em></em>
<img src="contact.jpg" alt="" />
<h2>Contact us</h2>
<h3>Donec condimentum</h3>
<ul>
<li>Phasellus vitae arcu et mauris facilisis ornare.</li>
<li>Nullam ultrices <a href="#nogo5">urna nec erat</a> facilisis faucibus.</li>
<li>Ut cursus posuere eros.</li>
<li>Vestibulum <a href="#nogo5">dapibus</a> tortor eu nisl.</li>
<li>Proin ac mauris non lacus pharetra aliquet.</li>
</ul>
<h3 class="clear">Contact Details</h3>
<p>Praesent vehicula interdum massa. Nunc velit erat, pulvinar vitae, tempor non, porttitor non, ipsum. Nullam venenatis, quam a tincidunt semper, neque velit dictum quam, at mattis mauris mauris a dolor. Aliquam urna. <a href="nogo5">Ut pellentesque dapibus quam.</a> Mauris dapibus dictum felis. Praesent tellus quam, aliquet in, malesuada aliquet, pretium non, eros. Cras aliquam ligula vitae nunc.</p>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>
</div>

<br>
<br>
<br>
<div>
</div>
</body>
</html>

<script language=javascript ></script>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式