Sha*_*dat 1 javascript jquery html5 menu css3
我想实现一个树状菜单像波纹管采用HTML5和CSS3或jQuery的菜单或以某种方式使用普通的HTML,CSS和JavaScript的链接.
http://www.crystal.ch/abb/power_systems_landscape/
您可能会注意到涉及以下问题,
在这里你看到顺畅地上下滑动对我来说没问题.
任何想法或参考将不胜感激.谢谢
首先,我们需要HTML
<p class="menu_head">first</p>
<div class="menu_body">
<a href="">1</a>
<a href="">2</a>
<a href="">3</a>
<a href="">4</a>
</div>
<p class="menu_head1">Second</p>
<div class="menu_body">
<a href="">1</a>
</div>
Run Code Online (Sandbox Code Playgroud)
Jquery的效果
$("#firstpane p.menu_head").click(function()
{
$(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
});
$("#firstpane p.menu_head1").click(function()
{
$(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
});
$("#firstpane p.menu_head").mouseover(function()
{
$(this).css("text-indent","35px");
$(this).css("backgroundImage","url(images/trans.png)").fadeTo("slow",0.33);
});
$("#firstpane p.menu_head").mouseout(function()
{
$(this).css("text-indent","10px");
$(this).css("backgroundImage","url(images/headbot1.png)").fadeTo("slow", 1);
});
Run Code Online (Sandbox Code Playgroud)
我为你的玻璃效果添加了mouseover和mouseout.只需创建一个白色或任何颜色的背景或只是擦除.css可以这样做.
$(this).fadeTo("slow",0.33);
Run Code Online (Sandbox Code Playgroud)
CSS
.menu_head {
font-family: arial;font-weight: bold;
font-size:10px;
color: black;
left:3%;
height:7px;
text-indent:10px;
padding: 10px 10px;
cursor: pointer;
position: relative;
margin:1px;
font-weight:bold;
vertical-align: middle;
}
.menu_head1 {
font-family: arial;font-weight: bold;
font-size:10px;
color: black;
left:3%;
height:7px;
text-indent:10px;
padding: 10px 10px;
cursor: pointer;
position: relative;
margin:1px;
font-weight:bold;
vertical-align: middle;
}
.menu_body {
display:none;
}
.menu_body a{
font-family: arial;font-weight: bold;
left:3%;
width: 220px;
height:7px;
text-indent:10px;
position:relative;
padding: 10px 15px;
display:block;
color:#006699;
padding-left:10px;
font-weight:bold;
font-size:10px;
text-decoration:none;
vertical-align: middle;
}?
Run Code Online (Sandbox Code Playgroud)
见例子
尝试编辑css,因为它是为了适应我的网站.Gudluck