导航:首页 > 万维百科 > 网页左侧导航菜单设计

网页左侧导航菜单设计

发布时间:2020-12-15 11:52:03

1、div左侧导航菜单

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>导航菜单</title>
<style type="text/css">
.titleStyle{
background-color:#008800;color:#ffffff;border-top:1px solid #FFFFFF;font-size:9pt;cursor:hand;
}
.contentStyle{
background-color:#eeffee;color:blue;font-size:9pt;
}

a{
color:blue;
}
body{
font-size:9pt;
}
</style>
</head>
<body>

<script language="JavaScript">
<!--
var layerTop=20; //菜单顶边距
var layerLeft=30; //菜单左边距
var layerWidth=140; //菜单总宽
var titleHeight=20; //标题栏高度
var contentHeight=200; //内容区高度
var stepNo=10; //移动步数,数值越大移动越慢

var itemNo=0;runtimes=0;
document.write('<span id=itemsLayer style="position:absolute;overflow:hidden;border:1px solid #008800;left:'+layerLeft+';top:'+layerTop+';width:'+layerWidth+';">');

function addItem(itemTitle,itemContent){
itemHTML='<div id=item'+itemNo+' itemIndex='+itemNo+' style="position:relative;left:0;top:'+(-contentHeight*itemNo)+';width:'+layerWidth+';"><table width=100% cellspacing="0" cellpadding="0">'+
'<tr><td height='+titleHeight+' onclick=changeItem('+itemNo+') class="titleStyle" align=center>'+itemTitle+'</td></tr>'+
'<tr><td height='+contentHeight+' class="contentStyle">'+itemContent+'</td></tr></table></div>';
document.write(itemHTML);
itemNo++;
}
//添加菜单标题和内容,可任意多项,注意格式:
addItem('欢迎','<BR> 欢迎光临设计在线!');
addItem('网页陶吧','<center><a href="#">网页工具</a> <BR><BR><a href="#">技术平台</a> <BR><BR><a href="#">设计理念</a> <BR><BR><a href="#">更多</a></center>');
addItem('美工教室','<center><a href="#">平面设计 </a> <BR><BR><a href="#">三维空间</a> <BR><BR><a href="#">设计基础</a> <BR><BR><a href="#">更多..</a></center>');
addItem('Flash','<center><a href="#">基础教程</a> <BR><BR><a href="#">技巧运用</a> <BR><BR><a href="#">实例剖析</a> <BR><BR><a href="#">更多..</a></center>');
addItem('多媒体','<center><a href="#">DIRECTOR</a> <BR><BR><a href="#">Authorware</a> <BR><BR><a href="#">更多..</a></center>');
addItem('精品赏析','<center><a href="#">设计精品</a></center>');

document.write('</span>')
document.all.itemsLayer.style.height=itemNo*titleHeight+contentHeight;

toItemIndex=itemNo-1;onItemIndex=itemNo-1;

function changeItem(clickItemIndex){
toItemIndex=clickItemIndex;
if(toItemIndex-onItemIndex>0) moveUp(); else moveDown();
runtimes++;
if(runtimes>=stepNo){
onItemIndex=toItemIndex;
runtimes=0;}
else
setTimeout("changeItem(toItemIndex)",10);
}

function moveUp(){
for(i=onItemIndex+1;i<=toItemIndex;i++)
eval('document.all.item'+i+'.style.top=parseInt(document.all.item'+i+'.style.top)-contentHeight/stepNo;');
}

function moveDown(){
for(i=onItemIndex;i>toItemIndex;i--)
eval('document.all.item'+i+'.style.top=parseInt(document.all.item'+i+'.style.top)+contentHeight/stepNo;');
}
changeItem(0);
//-->
</script>
</body>
</html>

2、网页设计左侧导航栏

可以用js来实现,给每一项添加鼠标移入事件,当鼠标移入的时候,显示右边提前写好的内容,鼠标移开后再次隐藏。

附件是我写的一个京东页面最头部部分的例子


3、html 前端页面,如果用bootstrap4制作左侧菜单栏?

虽然现在不怎么纯手工敲了,但是我还是可以给你说一下思路。
你先给一个div,{width:200px;height:400px;float:left;}
在这个div里面放10个小的div{width:200px;height:40px;}
然后就是js了,你想要什么效果,就在hover或者click里面加。(个人默认你懂jQ)

4、网页导航栏模块设计CSS控制默认第一个LI背影

像上面那种,就是定义ACTIVE属性,使其A的背影带色,每个页植入对应的ACTIVE,比如,首页专只属植入在第一个LI,第二个页只植入第二个LI。。。另外定义LI属性,使其HOVER的背影跟ACTIVE的背影色一样,这样子移动鼠标时对应的LI就显示背影色,点击后的背影色也不变。

5、网页设计,导航菜单,我想实现一个很常见的效果

<style>
#div1{ background:url(img_1.gif) ; }
#div1:hover{ background:url(img_2.gif); }
</style>
<div id="div1">hello</div>
不需要js

6、框架网页中如何实现左边导航栏一点击右边自动变换网页效果??

看你发了两次,我决定回答两次多赚点分~~嘿嘿!

你这个框架网页实际包含三个网页不是。在nain文件里frame标签下有有name="",记住引号里的东西。在left文件的链接标签上加上target="",引号里是你要右边框架的name。
如下:<a href="www.htm" target="mainFrame">

好像在main文件的frame标签下加上target="mainFrame" 也能实现这个效果,但是我昨天没试成功,令我很郁闷。网页有几种打开方式:1.在原来窗口中打开_self,2.在新窗口中打开_blank,3.在父窗口中打开_parent.自己试着玩吧,在dw中的设置是链接下的目标选择。

与网页左侧导航菜单设计相关的知识