代码简介:

JS超级酷的导航菜单代码,类似WINDOWS风格的导航,又又立体效果,很不错的,赶快运行一下,一睹为快吧。

代码内容:

<HTML>
<HEAD>
<TITLE>JS超级酷的导航菜单代码_网页代码站(www.webdm.cn)</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type><SCRIPT  type=text/javascript>var dragobject = null;
var tx;
var ty;function getReal(el) {temp = el;while ((temp != null) && (temp.tagName != "BODY")) {if ((temp.className == "moveme") || (temp.className == "handle")){el = temp;return el;}temp = temp.parentElement;}return el;
}function moveme_onmousedown() {el = getReal(window.event.srcElement)if (el.className == "moveme") {dragobject = el;ty = (window.event.clientY - dragobject.style.pixelTop);tx = (window.event.clientX - dragobject.style.pixelLeft);window.event.returnValue = false;window.event.cancelBubble = true;}else if (el.className == "handle") {tmp = el.getAttribute("for");if (tmp != null) {el = eval(tmp);dragobject = el;ty = (window.event.clientY - dragobject.style.pixelTop);tx = (window.event.clientX - dragobject.style.pixelLeft);window.event.returnValue = false;window.event.cancelBubble = true;}else {dragobject = null;}}else {dragobject = null;}
}function moveme_onmouseup() {if(dragobject) {dragobject = null;}
}function moveme_onmousemove() {if (dragobject) {if(window.event.clientX >= 0) {dragobject.style.left = window.event.clientX - tx;dragobject.style.top = window.event.clientY - ty;}window.event.returnValue = false;window.event.cancelBubble = true;}
}if (document.all) { //This only works in IE4 or betterdocument.onmousedown = moveme_onmousedown;document.onmouseup = moveme_onmouseup;document.onmousemove = moveme_onmousemove;
}document.write("<style>");
document.write(".moveme        {cursor: move;}");
document.write(".handle        {cursor: move;}");
document.write("</style>");
</SCRIPT><SCRIPT  type=text/javascript>document.onmouseover = doOver;
document.onmouseout  = doOut;
document.onmousedown = doDown;
document.onmouseup   = doUp;function doOver() {var toEl = getReal(window.event.toElement, "className", "coolButton");var fromEl = getReal(window.event.fromElement, "className", "coolButton");if (toEl == fromEl) return;var el = toEl;//    alert(el);//    var cDisabled = el.getAttribute("cDisabled");var cDisabled = el.cDisabled;
//  alert(cDisabled);cDisabled = (cDisabled != null); // If CDISABLED atribute is presentif (el.className == "coolButton")el.onselectstart = new Function("return false");if ((el.className == "coolButton") && !cDisabled) {makeRaised(el);makeGray(el,false);}
}function doOut() {var toEl = getReal(window.event.toElement, "className", "coolButton");var fromEl = getReal(window.event.fromElement, "className", "coolButton");if (toEl == fromEl) return;var el = fromEl;//   var cDisabled = el.getAttribute("cDisabled");var cDisabled = el.cDisabled;cDisabled = (cDisabled != null); // If CDISABLED atribute is presentvar cToggle = el.cToggle;toggle_disabled = (cToggle != null); // If CTOGGLE atribute is presentif (cToggle && el.value) {makePressed(el);makeGray(el,true);}else if ((el.className == "coolButton") && !cDisabled) {makeFlat(el);makeGray(el,true);}}function doDown() {el = getReal(window.event.srcElement, "className", "coolButton");var cDisabled = el.cDisabled;cDisabled = (cDisabled != null); // If CDISABLED atribute is presentif ((el.className == "coolButton") && !cDisabled) {makePressed(el)}
}function doUp() {el = getReal(window.event.srcElement, "className", "coolButton");var cDisabled = el.cDisabled;cDisabled = (cDisabled != null); // If CDISABLED atribute is presentif ((el.className == "coolButton") && !cDisabled) {makeRaised(el);}
}function getReal(el, type, value) {temp = el;while ((temp != null) && (temp.tagName != "BODY")) {if (eval("temp." + type) == value) {el = temp;return el;}temp = temp.parentElement;}return el;
}function findChildren(el, type, value) {var children = el.children;var tmp = new Array();var j=0;for (var i=0; i<children.length; i++) {if (eval("children[i]." + type + "==\"" + value + "\"")) {tmp[tmp.length] = children[i];}tmp = tmp.concat(findChildren(children[i], type, value));}return tmp;
}function disable(el) {if (document.readyState != "complete") {window.setTimeout("disable(" + el.id + ")", 100);   // If document not finished rendered try later.return;}var cDisabled = el.cDisabled;cDisabled = (cDisabled != null); // If CDISABLED atribute is presentif (!cDisabled) {el.cDisabled = true;el.innerHTML = '<span style="background: buttonshadow; width: 100%; height: 100%; text-align: center;">' +'<span style="filter:Mask(Color=buttonface) DropShadow(Color=buttonhighlight, OffX=1, OffY=1, Positive=0); height: 100%; width: 100%%; text-align: center;">' +el.innerHTML +'</span>' +'</span>';if (el.onclick != null) {el.cDisabled_onclick = el.onclick;el.onclick = null;}}
}function enable(el) {var cDisabled = el.cDisabled;cDisabled = (cDisabled != null); // If CDISABLED atribute is presentif (cDisabled) {el.cDisabled = null;el.innerHTML = el.children[0].children[0].innerHTML;if (el.cDisabled_onclick != null) {el.onclick = el.cDisabled_onclick;el.cDisabled_onclick = null;}}
}function addToggle(el) {var cDisabled = el.cDisabled;cDisabled = (cDisabled != null); // If CDISABLED atribute is presentvar cToggle = el.cToggle;cToggle = (cToggle != null); // If CTOGGLE atribute is presentif (!cToggle && !cDisabled) {el.cToggle = true;if (el.value == null)el.value = 0;        // Start as not pressed downif (el.onclick != null)el.cToggle_onclick = el.onclick;   // Backup the onclickelse el.cToggle_onclick = "";el.onclick = new Function("toggle(" + el.id +"); " + el.id + ".cToggle_onclick();");}
}function removeToggle(el) {var cDisabled = el.cDisabled;cDisabled = (cDisabled != null); // If CDISABLED atribute is presentvar cToggle = el.cToggle;cToggle = (cToggle != null); // If CTOGGLE atribute is presentif (cToggle && !cDisabled) {el.cToggle = null;if (el.value) {toggle(el);}makeFlat(el);if (el.cToggle_onclick != null) {el.onclick = el.cToggle_onclick;el.cToggle_onclick = null;}}
}function toggle(el) {el.value = !el.value;if (el.value)el.style.background = "URL()";elseel.style.backgroundImage = "";//   doOut(el);
}function makeFlat(el) {with (el.style) {background = "";border = "1px solid buttonface";padding      = "1px";}
}function makeRaised(el) {with (el.style) {borderLeft   = "1px solid buttonhighlight";borderRight  = "1px solid buttonshadow";borderTop    = "1px solid buttonhighlight";borderBottom = "1px solid buttonshadow";padding      = "1px";}
}function makePressed(el) {with (el.style) {borderLeft   = "1px solid buttonshadow";borderRight  = "1px solid buttonhighlight";borderTop    = "1px solid buttonshadow";borderBottom = "1px solid buttonhighlight";paddingTop    = "2px";paddingLeft   = "2px";paddingBottom = "0px";paddingRight  = "0px";}
}function makeGray(el,b) {var filtval;if (b)filtval = "gray()";elsefiltval = "";var imgs = findChildren(el, "tagName", "IMG");for (var i=0; i<imgs.length; i++) {imgs[i].style.filter = filtval;}}document.write("<style>");
document.write(".coolBar   {background: buttonface;border-top: 1px solid buttonhighlight;  border-left: 1px solid buttonhighlight; border-bottom: 1px solid buttonshadow; border-right: 1px solid buttonshadow; padding: 2px; font: menu;}");
document.write(".coolButton {border: 1px solid buttonface; padding: 1px; text-align: center; cursor: default;}");
document.write(".coolButton IMG    {filter: gray();}");
document.write("</style>");</SCRIPT><SCRIPT type=text/javascript>
<!--document.onmousedown = initDown;
document.onmouseup   = initUp;
document.onmousemove = initMove;function initDown() {doDown();moveme_onmousedown();
}function initUp() {doUp();moveme_onmouseup();
}function initMove() {moveme_onmousemove();
}//-->
</SCRIPT><STYLE type=text/css>BODY {FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; MARGIN-TOP: 0px
}
.pt9 {FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
</STYLE><META content="Microsoft FrontPage 4.0" name=GENERATOR>
</HEAD><BODY bgColor=#e0dfde leftMargin=0 topMargin=0><SCRIPT language=JavaScript>
var mylocation="index.htm"
var winheight=100
var winsize=100
var x=5
function go(){
win2=window.open("","","scrollbars")
win2.location=mylocation
if (!document.layers&&!document.all){
win2.location=mylocation
return}
win2.resizeTo(100,100)
win2.moveTo(0,0)
go2()}
function go2(){
if (winheight>=screen.availHeight-3)
x=0
win2.resizeBy(5,x)
winheight+=5
winsize+=5
if (winsize>=screen.width-5){
win2.location=mylocation
winheight=100
winsize=100
x=5
return}
setTimeout("go2()",50)
}
</SCRIPT><DIV align=left>
<TABLE cellPadding=0 class=coolBar id=toolbar1
style="LEFT: 0px; POSITION: relative; TOP: 0px; Z-INDEX: 99" width="100%"><TBODY><TR><TD class=coolButton οnclick=javascript:history.go(-1)><NOBR><IMG height=16 src="http://www.webdm.cn/images/20091114/jian.gif" width=16>回上一步</NOBR></TD><TD class=coolButton οnclick="window.open('/', '_blank')"><NOBR><IMG height=16 src="http://www.webdm.cn/images/20091114/home.gif" width=16>回到首页</NOBR></TD><TD class=coolButton οnclick="window.open('/', '_blank')"><NOBR><IMG height=16 src="http://www.webdm.cn/images/20091114/search.gif" width=16>最新JS脚本</NOBR> </TD><TD class=coolButton οnclick="window.open('/', 'main')"><NOBR><IMG height=16 src="http://www.webdm.cn/images/20091114/win16.gif" width=16>JavaApplet</NOBR> </TD><TD class=coolButton οnclick="window.open('/', 'main')"><NOBR><IMG height=16 src="http://www.webdm.cn/images/20091114/read.gif" width=16>免费资源</NOBR></TD><TD class=coolButton οnclick="window.open('/', 'main')"><NOBR><IMG height=16 src="http://www.webdm.cn/images/20091114/mail.gif" width=16>订阅本站邮件</NOBR> </TD><TD class=coolButton οnclick="window.open('/', '_blank')"><NOBR><IMG height=16 src="http://www.webdm.cn/images/20091114/write.gif" width=16>本站留言板</NOBR> </TD><TD class=coolButton οnclick="window.open('/', 'main')"><NOBR><IMG height=16 src="http://www.webdm.cn/images/20091114/win16.gif" width=16>本站导航地图</NOBR> </TD><TD class=coolButton οnclick="window.open('/', '_blank')"><NOBR><IMG height=16 src="http://www.webdm.cn/images/20091114/lt.gif" width=16>本站论坛</NOBR>
</TD></TR></TBODY></TABLE></DIV></BODY></HTML>
<br>
<p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!</p>

代码来自:http://www.webdm.cn/webcode/1aa50ca7-358e-4ef2-ae7d-ac56957e99a3.html

转载于:https://www.cnblogs.com/webdm/archive/2011/05/05/2037374.html

JS超级酷的导航菜单代码相关推荐

  1. 弧形背景html,JS实现带圆弧背景渐变效果的导航菜单代码

    本文实例讲述了JS实现带圆弧背景渐变效果的导航菜单代码.分享给大家供大家参考.具体如下: 这是一款效果个性的JS+CSS导航菜单,鼠标经过时出现有趣弧形背景,实际上,这里用CSS调用了背景,用Java ...

  2. 基于jQuery垂直多级导航菜单代码

    基于jQuery垂直多级导航菜单代码是一款黑色风格的jQuery竖直导航菜单特效下载.效果图如下: 在线预览    源码下载 实现的代码. html代码: <ul class="ce& ...

  3. JS打字效果的动态菜单代码分享

    这篇文章主要介绍了JS打字效果的动态菜单,推荐给大家,有需要的小伙伴可以参考下. 这是一款基于javascript实现的打字效果的动态菜单特效代码,分享给大家学习学习. 小提示:浏览器中如果不能正常运 ...

  4. 蓝色箭头间隔css导航菜单代码

    蓝色箭头间隔css导航菜单代码 演示图片: 详细代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN&qu ...

  5. JS+CSS竖向折叠滑动菜单代码

    代码简介: 折叠菜单,竖向展开,点击时缓慢展开,展开后可以作为菜单的栏目介绍等,还算不错. 代码内容: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ...

  6. CSS写的青色漂亮导航菜单代码

    代码简介: 简洁型的CSS导航菜单,没有用到图片,但看着很舒服,老外网站的东西,CSS代码很简洁,复制代码即可使用. 代码内容: <!DOCTYPE HTML PUBLIC "-//W ...

  7. Java制作二级导航菜单_纯CSS实现超简单的二级下拉导航菜单代码

    本文实例讲述了纯CSS实现超简单的二级下拉导航菜单代码.分享给大家供大家参考.具体如下: 这是一款纯CSS菜单,二级下拉导航效果,是最简洁的CSS导航菜单,兼容性也很棒,IE7/8.火狐等都支持,而且 ...

  8. 很漂亮的蓝色经典CSS导航菜单代码

    代码简介:很不错的一款蓝色风格经典的CSS导航菜单,只不过用到了几张背景图片,好像这些图片可以合并起来用,有兴趣用的朋友可以适当优化一下,从外观上来看,这款菜单还是非常好看的. 代码内容: <! ...

  9. html导航栏圆角,纯css实现蓝色圆角效果水平导航菜单代码

    纯css实现蓝色圆角效果水平导航菜单代码 这是一款可爱的蓝色圆角水平导航菜单,用到几张背景图片,我觉得这款菜单挺实用,特别是用在个人博客中非常合适.在兼容性方面做的'也很好,几乎兼容所有的浏览器. 运 ...

最新文章

  1. linux有关Block的知识
  2. php实现小说字典功能_四十章 PHP实现获取并生成数据库字典的方法
  3. Mqtt协议IOS端移植3
  4. mongodb更新操作符$min,$max
  5. for i in range什么意思_python迭代和解析——range、map函数
  6. ktor HTTP API 练习
  7. Linux 基金会成立持续交付基金会
  8. [python] 对于arcpy的简单使用。
  9. c语言用二维数组学生姓名,C语言实验报告合集-_人人文库网
  10. 阻止第三方 cookie_如何在每个Web浏览器中阻止第三方Cookie
  11. Android shape属性大全
  12. SpringBoot 使用validation数据校验-超级详细 - 第406篇
  13. 计算机卸载或更改程序软件消失,win10系统控制面板“卸载或更改程序”窗口不显示已安装软件的还原方案...
  14. nginx 配置 同一域名端口下,根据URL 导向不同的项目目录
  15. textarea标签中的换行符和空格
  16. uni-app实现PDF预览功能(避坑看这)
  17. java中使用Jedis操作Redis实例
  18. 如何让DIV标签居中显示?
  19. 回顾2020,喜悲交叉
  20. html5标签不区分大小写对错,html5 不区分大小写、标记结束符及属性是否加引号?...

热门文章

  1. echarts中双y轴刻度线对齐的问题
  2. Html5文字阴影和盒子阴影
  3. android build.prop文件
  4. spring boot yml 文件的新的配置@value无法读取
  5. Golang 编写测试用例(单元测试、压力测试等)最新教程,细到极致
  6. 13 终于,成为自由职业者
  7. bzoj 3877: [Ahoi2014]保龄球
  8. 谈谈中行E令可能存在的问题
  9. 2023年HCIA-Cloud Service V3.0 H13-811(最新考试题库200题)
  10. blastFoam水下爆炸数值仿真计算