| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 522 人关注过本帖
标题:请教浮动导航的问题
只看楼主 加入收藏
annywen
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2005-9-13
收藏
 问题点数:0 回复次数:0 
请教浮动导航的问题

我找到一个浮动菜单的原代码,可是还是修改不好。主要是我在做链接的时候要进行判断。
<%if session("qx")="" then%><A target=_blank href="../login.asp"><%else%></a><A target=_blank href="../xx.asp"><%end if%><font color="#808000">值周公布</font></a>
<BR>
希望大家帮我看看.
学校领导要求作出二级弹出的浮动,我现在连浮动都实现不了.别说二级隐现了.
浮动菜单的原代码是这样的:
document.write("<style type=text/css>#master {LEFT: -100px; POSITION: absolute; TOP: 25px; VISIBILITY: visible; WIDTH: 200px; Z-INDEX: 2}#menu {LEFT: 100px; POSITION: absolute; TOP: 25px; VISIBILITY: visible; WIDTH: 18px; Z-INDEX: 5}#top {LEFT: 0px; POSITION: absolute; TOP: 25px; VISIBILITY: visible; WIDTH: 100px; Z-INDEX: 5}#screen {LEFT: 0px; POSITION: absolute; TOP: 31px; VISIBILITY: visible; WIDTH: 100px; Z-INDEX: 5}#screenlinks {LEFT: 0px; POSITION: absolute; TOP: 31px; VISIBILITY: visible; WIDTH: 100px; Z-INDEX: 5}</style>")
var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ie){
document.write('<style type="text/css">')
document.write("#screen {filter:Alpha(Opacity=30);}")
document.write("</style>")
}

if(ns){
document.write('<style type="text/css">')
document.write("#master {clip:rect(0,150,250,0);}")
document.write("</style>")
}


var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0


var master = new Object("element")
master.curLeft = -100; master.curTop = 10;
master.gapLeft = 0; master.gapTop = 0;
master.timer = null;

function moveAlong(layerName, paceLeft, paceTop, fromLeft, fromTop){
clearTimeout(eval(layerName).timer)

if(eval(layerName).curLeft != fromLeft){
if((Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft)) < paceLeft){eval(layerName).curLeft = fromLeft}
else if(eval(layerName).curLeft < fromLeft){eval(layerName).curLeft = eval(layerName).curLeft + paceLeft}
else if(eval(layerName).curLeft > fromLeft){eval(layerName).curLeft = eval(layerName).curLeft - paceLeft}
if(ie){document.all[layerName].style.left = eval(layerName).curLeft}
if(ns){document[layerName].left = eval(layerName).curLeft}
}

if(eval(layerName).curTop != fromTop){
if((Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop)) < paceTop){eval(layerName).curTop = fromTop}
else if(eval(layerName).curTop < fromTop){eval(layerName).curTop = eval(layerName).curTop + paceTop}
else if(eval(layerName).curTop > fromTop){eval(layerName).curTop = eval(layerName).curTop - paceTop}
if(ie){document.all[layerName].style.top = eval(layerName).curTop}
if(ns){document[layerName].top = eval(layerName).curTop}
}


eval(layerName).timer=setTimeout('moveAlong("'+layerName+'",'+paceLeft+','+paceTop+','+fromLeft+','+fromTop+')',30)
}

function setPace(layerName, fromLeft, fromTop, motionSpeed){
eval(layerName).gapLeft = (Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft))/motionSpeed
eval(layerName).gapTop = (Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop))/motionSpeed

moveAlong(layerName, eval(layerName).gapLeft, eval(layerName).gapTop, fromLeft, fromTop)
}

var expandState = 0

function expand(){
if(expandState == 0){setPace("master", 0, 10, 10); if(ie){document.menutop.src = "pic/menui.gif"}; expandState = 1;}
else{setPace("master", -100, 10, 10); if(ie){document.menutop.src = "pic/menuo.gif"}; expandState = 0;}
}
document.write("<div id=master><div id=menu onmouseover=\"javascript:expand()\"><table border=0 cellpadding=0 cellspacing=0 width=18><tbody><tr><td width=\"100%\"><a href=\"javascript:expand()\" onFocus=this.blur()><img alt=点击这里展开/关闭快捷菜单 border=0 height=70 name=menutop src=\"pic/menuo.gif\" width=18></a></td></tr></tbody></table></div><div id=top><table border=0 cellpadding=0 cellspacing=0 width=100><tbody><tr><td width=\"100%\"><img border=0 height=6 src=\"pic/menutop.gif\" width=100></td> </tr></tbody></table></div><div id=screen onmouseout=\"javascript:expand()\"><table border=0 cellpadding=5 cellspacing=0 width=100><tbody><tr><td bgcolor=#3399FF width=\"100%\"><table bgcolor=#3399FF border=0 cellpadding=0 cellspacing=0 width=\"100%\" height=225><tbody><tr><td width=\"100%\"><table border=0 cellpadding=5 cellspacing=1 width=\"100%\"><tbody><tr> <td bgcolor=#ecf6f5 width=\"100%\"><br><br><br><br><br></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div><div id=screenlinks ><table border=0 cellpadding=6 cellspacing=0 width=100><tbody><tr><td style=\"FILTER: alpha(opacity=90)\" width=\"100%\"><table bgcolor=#336666 border=0 cellpadding=0 cellspacing=0 width=\"100%\" ><tbody> <tr><td width=\"100%\"><table border=0 cellpadding=6 cellspacing=1 width=\"100%\"><tbody><tr><td bgcolor=#ecf6f5 width=\"100%\" align=\"center\"><font color=999900>常用链接</font><br>");


document.write("|-<%if session("qx")="" then%><A target=_blank href="../qx.asp"><%else%></a><A target=_blank href="../innet/gzjh/gzjh.htm"><%end if%>工作计划</a>");
document.write(" <BR>|-<%if session("qx")="" then%><A target=_blank href="../qx.asp"><%else%></a><A target=_blank href="../innet/gzjh/gzjh.htm"><%end if%>工作安排</a>");

document.write("├<a href=\"http://61.157.226.170/fyjh\" target=_blank\"\">江湖聊天</a><br>");
document.write("├<a href=\"http://usms.tom.com/smslist/list1/sms_1_3_6_0_1.htm?user_id=75260&:&http://snowbbs.com/pic/smslogo.gif\" target=_blank\"\">短信中心</a><br>");
document.write("├<a href=\"webvar/index.htm\" target=_blank\"\">卡片专卖</a><br>");
document.write("├<a href=\"kele8/index.htm\" target=_blank\"\">可 乐 吧</a><br>");
document.write("└<a href=\"\mywish/wish.asp\" target=_blank\"\">祈 愿 板</a><br>");

document.write("<font color=999900><font face=Wingdings>1</font>社区外设</font></font><br>");
document.write("├<a href=\"http://www.13900.net/vod/\" target=_blank\"\">免费影院</a><br>");
document.write("├<a href=\"http://www.6gu.com/\" target=_blank\"\">六姑网址</a><br>");
document.write("├<a href=\"http://www.13900.net\" target=_blank\"\">四海传奇</a><br>");

document.write("<a href=\"user/logout.asp\")\"><font color=999900><font face=Wingdings >v</font>退出社区</font></a><br>");
document.write("</td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div></div>");
if(ie){var sidemenu = document.all.master;}
if(ns){var sidemenu = document.master;}

function FixY(){
if(ie){sidemenu.style.top = document.body.scrollTop+10}
if(ns){sidemenu.top = window.pageYOffset+10}
}

setInterval("FixY()",100);

var currentpos,timer;
function initialize()
{
timer=setInterval ("scrollwindow ()",30);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize

搜索更多相关主题的帖子: 导航 
2005-11-17 22:16
快速回复:请教浮动导航的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.097669 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved