急求!导航条,css+js 下拉菜单的导航条,下面会有一段空白 而且鼠标移上 移下 下面的布局会随之移动 10
导航html代码如下<divid="menu"><ulclass="menu"><li></li><li><ahref="#"class="parent"><span>资...
导航html代码如下
<div id="menu">
<ul class="menu">
<li></li>
<li><a href="#" class="parent"><span>资金申请1</span></a>
<div><ul>
<li><a href="#"><span>积分明细</span></a></li>
<li><a href="#"><span>销量明细</span></a></li>
<li><a href="#"><span>奖金明细</span></a></li>
<li><a href="#"><span>积分计算模拟器</span></a></li>
<li><a href="#"><span>税金计算模拟器</span></a></li>
</ul></div>
</li>
<li ><a href="#"><span>资金申请2</span></a></li>
<li><a href="#"><span>资金申请3</span></a></li>
<li><a href="#"><span>资金申请4</span></a></li>
<li><a href="#"><span>资金申请5</span></a></li>
<li><a href="#"><span>资金申请6</span></a></li>
<li class="last"><a href="#"><span>资金申请7</span></a></li>
<li class="back" style="width: 10px; display: block; overflow: hidden; left: 539px;"></li>
</ul>
</div>
导航样式如下
<!------导航菜单-------->
div#menu{ height:37px; width:947px; padding-bottom:250px;
}
div#menu ul {
margin: 0;
padding: 0;
list-style: none;
float: left;
}
div#menu ul.menu {
padding-left: 60px; background:url(../images/dh_bg.jpg); background-repeat:no-repeat; text-align:right;}
div#menu ul.menu li{}
div#menu .menu li{
position: relative;
z-index: 9;
margin: 0;
display: block;
float: left;
height:37px;
width:113px;
}
div#menu .menu li div li{height:25px; width:110px;}
div#menu .menu li div li span { position: relative;z-index: 9; margin: 0; padding: 0; display: block; float: left; height:25px;}
/*div#menu li:hover>ul {
left: -2px;
}
*/
div#menu li div {
list-style: none;
float: left;
position: absolute;
top: 35px;
left: 0;
width: 110px;
z-index: 11;
visibility: hidden;
}
div#menu li:hover>div {
visibility: visible;
}
div#menu li.current a {}
/* menu::level1 */
div#menu li a {
position: relative;
z-index: 10;
display: block;
float: left;
text-decoration: none;
text-align:center;
padding:0 10px 0 10px;
}
div#menu .menu li span {
font: normal 13px '微软雅黑';
line-height:37px;
color: #3f3f3f;
font-weight:bold;
display: block;
cursor: pointer;
}
div#menu ul a:hover span {
color: #353535;
}
div#menu .menu li div li { background:url(../images/dh_002a.png) no-repeat left;}
div#menu .menu li div li a span {
font: normal 12px '微软雅黑' ;
text-align:center;
line-height:25px;
color: #1b1b1b;
display: block;
cursor: pointer;
}
div#menu .menu li div li a:hover span{color: #787878;}
div#menu li {}
<!------下拉菜单结束---------> 展开
<div id="menu">
<ul class="menu">
<li></li>
<li><a href="#" class="parent"><span>资金申请1</span></a>
<div><ul>
<li><a href="#"><span>积分明细</span></a></li>
<li><a href="#"><span>销量明细</span></a></li>
<li><a href="#"><span>奖金明细</span></a></li>
<li><a href="#"><span>积分计算模拟器</span></a></li>
<li><a href="#"><span>税金计算模拟器</span></a></li>
</ul></div>
</li>
<li ><a href="#"><span>资金申请2</span></a></li>
<li><a href="#"><span>资金申请3</span></a></li>
<li><a href="#"><span>资金申请4</span></a></li>
<li><a href="#"><span>资金申请5</span></a></li>
<li><a href="#"><span>资金申请6</span></a></li>
<li class="last"><a href="#"><span>资金申请7</span></a></li>
<li class="back" style="width: 10px; display: block; overflow: hidden; left: 539px;"></li>
</ul>
</div>
导航样式如下
<!------导航菜单-------->
div#menu{ height:37px; width:947px; padding-bottom:250px;
}
div#menu ul {
margin: 0;
padding: 0;
list-style: none;
float: left;
}
div#menu ul.menu {
padding-left: 60px; background:url(../images/dh_bg.jpg); background-repeat:no-repeat; text-align:right;}
div#menu ul.menu li{}
div#menu .menu li{
position: relative;
z-index: 9;
margin: 0;
display: block;
float: left;
height:37px;
width:113px;
}
div#menu .menu li div li{height:25px; width:110px;}
div#menu .menu li div li span { position: relative;z-index: 9; margin: 0; padding: 0; display: block; float: left; height:25px;}
/*div#menu li:hover>ul {
left: -2px;
}
*/
div#menu li div {
list-style: none;
float: left;
position: absolute;
top: 35px;
left: 0;
width: 110px;
z-index: 11;
visibility: hidden;
}
div#menu li:hover>div {
visibility: visible;
}
div#menu li.current a {}
/* menu::level1 */
div#menu li a {
position: relative;
z-index: 10;
display: block;
float: left;
text-decoration: none;
text-align:center;
padding:0 10px 0 10px;
}
div#menu .menu li span {
font: normal 13px '微软雅黑';
line-height:37px;
color: #3f3f3f;
font-weight:bold;
display: block;
cursor: pointer;
}
div#menu ul a:hover span {
color: #353535;
}
div#menu .menu li div li { background:url(../images/dh_002a.png) no-repeat left;}
div#menu .menu li div li a span {
font: normal 12px '微软雅黑' ;
text-align:center;
line-height:25px;
color: #1b1b1b;
display: block;
cursor: pointer;
}
div#menu .menu li div li a:hover span{color: #787878;}
div#menu li {}
<!------下拉菜单结束---------> 展开
2个回答
展开全部
<html>
<head>
<title>caculator</title>
<script type="text/javascript">
var countString="";
var tempString = "";//用来判断是否按过等号
function set(number){
if(number=="="){
if(countString=="")return;
tempString = "1";
var end = eval(countString);
document.getElementById("result").value = end;
countString = end;
}else{
if (tempString != "1"){
countString = countString + number;
document.getElementById("result").value = countString;
}else {
tempString = "0"
countString = "";
countString = countString + number;
document.getElementById("result").value = countString;
}
}
}
function cancel(){
countString ="";
document.getElementById("result").value = "";
}
function backspace(){
if(tempString =="1"){
alert("计算结果不可以修改!")
return;
}
countString=countString.substr(0,countString.length - 1);
document.getElementById("result").value = countString;
}
/*开方*/
function sqrtNum() {
//countSting 转化成数值类型的保险一点
countString = Math.sqrt(parseInt(countString));
document.getElementById("result").value = countString;
countString="";
}
/*添加正号负号*/
function mark(){
if(countString == "0"){
return;
}
if(countString.substr(0,1) != "-"){
countString = "-" + countString;
}else{
countString = countString.substr(1 , countString.length)
}
document.getElementById("result").value = countString;
}
/*倒数*/
function f(){
countString=1/countString;
document.getElementById("result").value = countString;
countString="";
}
/*键盘数字*/
function keyDown(){
var e = event.keyCode;
var i ;
/*数字*/
for(i = 0;i <= 9; i++ ){
if(e == (i + 96) || e == (i + 48)){
document.getElementById("num" + i).click();
}
}
/* 加
减
乘
除
小数点
等号
*/
switch(e){
case 107://加
tempString="0";
document.getElementById("plus").click();
break;
case 109://减
tempString="0";
document.getElementById("subtract").click();
break;
case 106://乘
tempString="0";
document.getElementById("mul").click();
break;
case 111://除
tempString="0";
document.getElementById("division").click();
break;
case 110://小数点
document.getElementById("spot").click();
break;
case 8:
document.getElementById("back").click();
event.keyCode=0;
event.returnValue=false;
break;
case 27:
document.getElementById("cancle").click();
event.keyCode=0;
event.returnValue=false;
break;
case 191:
document.getElementById("f1").click();
break;
case 83:
document.getElementById("sqrt1").click();
break;
case 13://等号
document.getElementById("equal").click();
break;
}
}
</script>
<style>
input{
width:40px;
}
</style>
</head>
<body onkeydown="keyDown();">
<!--<body onkeydown="alert(event.keyCode)">-->
<form name="formname">
<table border="1px">
<tr>
<td colspan="5"><input type="text" id="result" disabled="disabled" style="width:225px;" maxlength="10"/></td>
</tr>
<tr>
<td colspan="3"><input type="text" id="result" disabled="disabled" style="width:135px;"/></td>
<td><input id="cancle" type="button" value="C E" onclick="cancel()" /></td>
<td><input id="back" type="button" value="退格" name="bs" onClick="backspace()"/> </td>
</tr>
<tr>
<td><input id="num7" type="button" value=" 7 " name="num7" onclick="set(7)" /></td>
<td><input id="num8" type="button" value=" 8 " name="num8" onclick="set(8)" /></td>
<td><input id="num9" type="button" value=" 9 " name="num9" onclick="set(9)" /></td>
<td><input id="division" type="button" value=" / " name="division" onclick="set('/')" /></td>
<td><input id="sqrt1" type="button" value=" sqrt " name="sqrt" onclick="sqrtNum()" /></td>
</tr>
<tr>
<td><input id="num4" type="button" value=" 4 " name="num4" onclick="set(4)" /></td>
<td><input id="num5" type="button" value=" 5 " name="num5" onclick="set(5)" /></td>
<td><input id="num6" type="button" value=" 6 " name="num6" onclick="set(6)" /></td>
<td><input id="mul" type="button" value=" * " name="multiply" onclick="set('*')" /></td>
<td><input type="button" value=" % " name="scope" onclick="set('%')" /></td>
</tr>
<tr>
<td><input id="num1" type="button" value=" 1 " name="num1" onclick="set(1)" /></td>
<td><input id="num2" type="button" value=" 2 " name="num2" onclick="set(2)" /></td>
<td><input id="num3" type="button" value=" 3 " name="num3" onclick="set(3)" /></td>
<td><input id="subtract" type="button" value=" - " name="minus" onclick="set('-')" /></td>
<td><input id="f1" type="button" value=" 1/x " name="fenshu" onclick="f()" /></td>
</tr>
<tr>
<td><input id="num0" type="button" value=" 0 " name="num0" onclick="set(0)" /></td>
<td><input type="button" value="+/-" name="haha" onclick="mark()"/></td>
<td><input id="spot"type="button" value=" . " name="point" onclick="set('.')" /></td>
<td><input id="plus" type="button" value=" + " name="sum" onclick="set('+')" /></td>
<td><input id="equal" type="button" value=" = " name="eq" onclick="set('=')" /></td>
</tr>
</table>
<font color="red" size="2">
大键盘“S”:对应“sqrt” <br>
大键盘“/”:对应“/”<br>
小键盘“+”:对应“+”<br>
小键盘“-”:对应“-”<br>
小键盘“*”:对应“*”<br>
小键盘“/”:对应“/”<br>
“ESC”:对应“C E”<br>
“Backspace”:对应“退格”
</font>
</form>
</body>
</html>
<head>
<title>caculator</title>
<script type="text/javascript">
var countString="";
var tempString = "";//用来判断是否按过等号
function set(number){
if(number=="="){
if(countString=="")return;
tempString = "1";
var end = eval(countString);
document.getElementById("result").value = end;
countString = end;
}else{
if (tempString != "1"){
countString = countString + number;
document.getElementById("result").value = countString;
}else {
tempString = "0"
countString = "";
countString = countString + number;
document.getElementById("result").value = countString;
}
}
}
function cancel(){
countString ="";
document.getElementById("result").value = "";
}
function backspace(){
if(tempString =="1"){
alert("计算结果不可以修改!")
return;
}
countString=countString.substr(0,countString.length - 1);
document.getElementById("result").value = countString;
}
/*开方*/
function sqrtNum() {
//countSting 转化成数值类型的保险一点
countString = Math.sqrt(parseInt(countString));
document.getElementById("result").value = countString;
countString="";
}
/*添加正号负号*/
function mark(){
if(countString == "0"){
return;
}
if(countString.substr(0,1) != "-"){
countString = "-" + countString;
}else{
countString = countString.substr(1 , countString.length)
}
document.getElementById("result").value = countString;
}
/*倒数*/
function f(){
countString=1/countString;
document.getElementById("result").value = countString;
countString="";
}
/*键盘数字*/
function keyDown(){
var e = event.keyCode;
var i ;
/*数字*/
for(i = 0;i <= 9; i++ ){
if(e == (i + 96) || e == (i + 48)){
document.getElementById("num" + i).click();
}
}
/* 加
减
乘
除
小数点
等号
*/
switch(e){
case 107://加
tempString="0";
document.getElementById("plus").click();
break;
case 109://减
tempString="0";
document.getElementById("subtract").click();
break;
case 106://乘
tempString="0";
document.getElementById("mul").click();
break;
case 111://除
tempString="0";
document.getElementById("division").click();
break;
case 110://小数点
document.getElementById("spot").click();
break;
case 8:
document.getElementById("back").click();
event.keyCode=0;
event.returnValue=false;
break;
case 27:
document.getElementById("cancle").click();
event.keyCode=0;
event.returnValue=false;
break;
case 191:
document.getElementById("f1").click();
break;
case 83:
document.getElementById("sqrt1").click();
break;
case 13://等号
document.getElementById("equal").click();
break;
}
}
</script>
<style>
input{
width:40px;
}
</style>
</head>
<body onkeydown="keyDown();">
<!--<body onkeydown="alert(event.keyCode)">-->
<form name="formname">
<table border="1px">
<tr>
<td colspan="5"><input type="text" id="result" disabled="disabled" style="width:225px;" maxlength="10"/></td>
</tr>
<tr>
<td colspan="3"><input type="text" id="result" disabled="disabled" style="width:135px;"/></td>
<td><input id="cancle" type="button" value="C E" onclick="cancel()" /></td>
<td><input id="back" type="button" value="退格" name="bs" onClick="backspace()"/> </td>
</tr>
<tr>
<td><input id="num7" type="button" value=" 7 " name="num7" onclick="set(7)" /></td>
<td><input id="num8" type="button" value=" 8 " name="num8" onclick="set(8)" /></td>
<td><input id="num9" type="button" value=" 9 " name="num9" onclick="set(9)" /></td>
<td><input id="division" type="button" value=" / " name="division" onclick="set('/')" /></td>
<td><input id="sqrt1" type="button" value=" sqrt " name="sqrt" onclick="sqrtNum()" /></td>
</tr>
<tr>
<td><input id="num4" type="button" value=" 4 " name="num4" onclick="set(4)" /></td>
<td><input id="num5" type="button" value=" 5 " name="num5" onclick="set(5)" /></td>
<td><input id="num6" type="button" value=" 6 " name="num6" onclick="set(6)" /></td>
<td><input id="mul" type="button" value=" * " name="multiply" onclick="set('*')" /></td>
<td><input type="button" value=" % " name="scope" onclick="set('%')" /></td>
</tr>
<tr>
<td><input id="num1" type="button" value=" 1 " name="num1" onclick="set(1)" /></td>
<td><input id="num2" type="button" value=" 2 " name="num2" onclick="set(2)" /></td>
<td><input id="num3" type="button" value=" 3 " name="num3" onclick="set(3)" /></td>
<td><input id="subtract" type="button" value=" - " name="minus" onclick="set('-')" /></td>
<td><input id="f1" type="button" value=" 1/x " name="fenshu" onclick="f()" /></td>
</tr>
<tr>
<td><input id="num0" type="button" value=" 0 " name="num0" onclick="set(0)" /></td>
<td><input type="button" value="+/-" name="haha" onclick="mark()"/></td>
<td><input id="spot"type="button" value=" . " name="point" onclick="set('.')" /></td>
<td><input id="plus" type="button" value=" + " name="sum" onclick="set('+')" /></td>
<td><input id="equal" type="button" value=" = " name="eq" onclick="set('=')" /></td>
</tr>
</table>
<font color="red" size="2">
大键盘“S”:对应“sqrt” <br>
大键盘“/”:对应“/”<br>
小键盘“+”:对应“+”<br>
小键盘“-”:对应“-”<br>
小键盘“*”:对应“*”<br>
小键盘“/”:对应“/”<br>
“ESC”:对应“C E”<br>
“Backspace”:对应“退格”
</font>
</form>
</body>
</html>
追问
这是什么
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-02-22
展开全部
这里有一个js的多级联动下拉菜单
可以自定义位置和样式 比较实用
里面有教程和源码
可以自定义位置和样式 比较实用
里面有教程和源码
参考资料: http://www.blueidea.com/common/shoutbox/redir.asp?4=e&id=11931
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询