| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 872 人关注过本帖
标题:各位大哥帮忙
只看楼主 加入收藏
wanglong202
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2005-4-22
收藏
 问题点数:0 回复次数:1 
各位大哥帮忙

//Pop-it menu- By Dynamic Drive - Modified by Wbird //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com //This credit MUST stay intact for use var menuOffX=0 //菜单距连接文字最左端距离 var menuOffY=18 //菜单距连接文字顶端距离

var fo_shadows=new Array() var linkset=new Array()

////No need to edit beyond here

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1 var ns6=document.getElementById&&!document.all var ns4=document.layers //短信窗口 function openScript(url, width, height){ var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' ); } //插件窗口 function PlusOpen(url, width, height){ window.open(url,"PlusOpen",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=yes' ); }

function mybook() { h = 300; w = 300; t = ( screen.availHeight - h ) / 2; l = ( screen.availWidth - w ) / 2; window.open("http://forumAd.to5198.com/common/login.jsp?sCheckUrl=/out/login.jsp&sDesUrl=/out/mybook.jsp", "我的服务", "left=" + l + ",top=" + t + ",height=" + h + ",width=" + w + ",toolbar=no,status=no,scrollbars=no,resizable=yes" ); return; } function showmenu(e,vmenu,mod){ if (!document.all&&!document.getElementById&&!document.layers) return which=vmenu clearhidemenu() ie_clearshadow() menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : "" menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj if (ie4||ns6) menuobj.innerHTML=which else{ menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>') menuobj.document.close() } menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height eventX=ie4? event.clientX : ns6? e.clientX : e.x eventY=ie4? event.clientY : ns6? e.clientY : e.y var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY if (rightedge<menuobj.contentwidth) menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth+menuOffX : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth else menuobj.thestyle.left=ie4? ie_x(event.srcElement)+menuOffX : ns6? window.pageXOffset+eventX : eventX if (bottomedge<menuobj.contentheight&&mod!=0) menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY-23 : ns6? window.pageYOffset+eventY-menuobj.contentheight-10 : eventY-menuobj.contentheight else menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY : ns6? window.pageYOffset+eventY+10 : eventY menuobj.thestyle.visibility="visible" ie_dropshadow(menuobj,"#999999",3) return false }

function ie_y(e){ var t=e.offsetTop; while(e=e.offsetParent){ t+=e.offsetTop; } return t; } function ie_x(e){ var l=e.offsetLeft; while(e=e.offsetParent){ //这里从新得到父对象,根据上面的引用e的对象是event.srcElement;可是从新复值以后它的对象又是什么呢;应该怎么看最好举个例子.还有offsetparent,offsetleft有什么作用的具体点,谢谢. l+=e.offsetLeft; } return l; } function ie_dropshadow(el, color, size) { var i; for (i=size; i>0; i--) { var rect = document.createElement('div'); var rs = rect.style rs.position = 'absolute'; rs.left = (el.style.posLeft + i) + 'px'; rs.top = (el.style.posTop + i) + 'px'; rs.width = el.offsetWidth + 'px'; rs.height = el.offsetHeight + 'px'; rs.zIndex = el.style.zIndex - i; rs.backgroundColor = color; var opacity = 1 - i / (i + 1); rs.filter = 'alpha(opacity=' + (100 * opacity) + ')'; //el.insertAdjacentElement('afterEnd', rect); fo_shadows[fo_shadows.length] = rect; } } function ie_clearshadow() { for(var i=0;i<fo_shadows.length;i++) { if (fo_shadows[i]) fo_shadows[i].style.display="none" } fo_shadows=new Array(); }

function contains_ns6(a, b) { while (b.parentNode) if ((b = b.parentNode) == a) return true; return false; }

function hidemenu(){ if (window.menuobj) menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide" ie_clearshadow() }

function dynamichide(e){ if (ie4&&!menuobj.contains(e.toElement)) hidemenu() else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) hidemenu() }

function delayhidemenu(){ if (ie4||ns6||ns4) delayhide=setTimeout("hidemenu()",500) }

function clearhidemenu(){ if (window.delayhide) clearTimeout(delayhide) }

function highlightmenu(e,state){ if (document.all) source_el=event.srcElement else if (document.getElementById) source_el=e.target if (source_el.className=="menuitems"){ source_el.id=(state=="on")? "mouseoverstyle" : "" } else{ while(source_el.id!="popmenu"){ source_el=document.getElementById? source_el.parentNode : source_el.parentElement if (source_el.className=="menuitems"){ source_el.id=(state=="on")? "mouseoverstyle" : "" } } } }

if (ie4||ns6) document.onclick=hidemenu function doSClick() { var targetId, srcElement, targetElement, imageId, imageElement; srcElement = window.event.srcElement; targetId = srcElement.id + "content"; targetElement = document.all(targetId); imageId = srcElement.id; imageId = imageId.charAt(0); imageElement = document.all(imageId); if (targetElement.style.display == "none") { imageElement.src = "Skins/Default/minus.gif" targetElement.style.display = ""; } else { imageElement.src = "Skins/Default/plus.gif" targetElement.style.display = "none"; } } function doClick() { var targetId, srcElement, targetElement; srcElement = window.event.srcElement; targetId = srcElement.id + "_content"; targetElement = document.all(targetId); if (targetElement.style.display == "none") { srcElement.src = "Skins/Default/minus.gif" targetElement.style.display = ""; } else { srcElement.src = "Skins/Default/plus.gif" targetElement.style.display = "none"; } }

//HTML过滤函数 function HTMLEncode(text) { text = text.replace(/&/g, "&amp;") ; text = text.replace(/"/g, "&quot;") ; text = text.replace(/</g, "&lt;") ; text = text.replace(/>/g, "&gt;") ; text = text.replace(/'/g, "&#146;") ;

return text ; }

function runCode() //定义一个运行代码的函数, { var code=event.srcElement.parentElement.children[0].value; var newwin=window.open('','','height=400, width=650, top=0,left=0,toolbar=1, menubar=1, scrollbars=1, resizable=1, location=1, status=1'); newwin.opener = null // 防止代码对论谈页面修改 newwin.document.write(code); newwin.document.close(); newwin.document.charset="UTF-8"; }

搜索更多相关主题的帖子: 菜单 blank beyond credit source 
2005-05-06 23:37
bingxue2332
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:446
专家分:0
注 册:2004-11-6
收藏
得分:0 


这么多  但是我想 只要思路 是对的

代码还是好写吧  检查下看看那里问题

2005-05-07 09:44
快速回复:各位大哥帮忙
数据加载中...
 
   



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

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