查看: 5306|回复: 7
|
论坛header如何弄一个hyperlink
[复制链接]
|
|
好像佳礼的上面
不是有
政经文教 地方州属 人在海外 工作园地 家庭生活 宗教命理 青春广场 影音娱乐 闲情逸致 欢乐校园
美食旅游 体育汽车 医疗保健 电脑网络 工程设计 资讯科技 电玩游戏 人文空间 语文天地 交流建议
上面这些?
我想问问看如何弄呢
以下的代码我测试过了
但是不会出现下拉菜单
<div align="center">
<table border="0" width=92%" id="table1">
<tr>
<td><A onmouseover="ShowMenu('<a href=forumdisplay.php?fid=号码>板块名称</a><br><a href=forumdisplay.php?fid=号码>板块名称</a><br>')" href="index.php?gid=号码"><font class="navtd">分类名称</font></a> |
</td>
</tr>
</table>
</div> |
|
|
|
|
|
|
|
发表于 15-11-2005 09:34 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 15-11-2005 11:45 PM
|
显示全部楼层
ShowMenu 是一个Javascript function,
你没有这个function,当然不能 |
|
|
|
|
|
|
|

楼主 |
发表于 16-11-2005 01:39 AM
|
显示全部楼层
<body onmousemove=HideMenu();
topMargin=0 marginheight="0" marginwidth="0">
<DIV id=menuDiv
style="VISIBILITY: hidden; WIDTH: 0px; POSITION: absolute; HEIGHT: 0px"></DIV>
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide
function killErrors() {
return true;
}
window.onerror = killErrors;
// -->
</SCRIPT>
上面这些吗? |
|
|
|
|
|
|
|
发表于 16-11-2005 06:05 AM
|
显示全部楼层
既然是問了cari的代碼,怎麽你不會去看一下網頁中的代碼呢?
javascript部分
<script type="text/javascript">
/***********************************************
* AnyLink Drop Down Menu- ? Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
//選單内容部分
var menu1=new Array()
menu1[0]='<div align="left"><a href="/myforum/forumdisplay.php?fid=214"><font color=red>→</font> 独家新闻 </a>'
menu1[1]='<div align="left"><a href="/myforum/forumdisplay.php?fid=4"><font color=red>→</font> 政经文教</a>'
menu1[2]='<div align="left"><a href="/myforum/forumdisplay.php?fid=5"><font color=red>→</font> 投资理财</a>'
menu1[3]='<div align="left"><a href="/myforum/forumdisplay.php?fid=176"><font color=red>→</font> 马来西亚华语规范</a>'
menu1[4]='<div align="left"><a href="/myforum/forumdisplay.php?fid=186"><font color=red>→</font> 辩论论坛</a>'
menu1[5]='<div align="left"><a href="/myforum/forumdisplay.php?fid=245"><font color=red>→</font> 活动看板</a>'
var menuwidth='165px' //default menu width
var menubgcolor='#f9fcff' //menu bgcolor
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?
/////No further editting needed
var ie4=document.all
var ns6=document.getElementById&&!document.all
if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}
function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}
function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
return clickreturnvalue()
}
function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}
function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden" //隱藏對象
}
}
function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay) //指定的毫秒后執行hidemnu函數
}
function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
if (hidemenu_onclick=="yes")
document.onclick=hidemenu
</script>
html部分
<a href="/myforum/index.php?gid=2" onMouseover="dropdownmenu(this, event, menu1, '150px')" onMouseout="delayhidemenu()">政经文教</a>
如果你要更加方便且美觀的可以到這裡下載,得到代碼后要不要修改就看你了
http://www.opencube.com/ |
|
|
|
|
|
|
|

楼主 |
发表于 16-11-2005 07:32 PM
|
显示全部楼层
因为我抄的代码是别的论坛的
而且那些HTML我也编辑得很辛苦
所以不想再更改HTML方面
上面的代码
需要编辑的是这边对吗?
//選單内容部分
var menu1=new Array()
menu1[0]='<div align="left"><a href="/myforum/forumdisplay.php?fid=214"><font color=red>→</font> 独家新闻 </a>'
menu1[1]='<div align="left"><a href="/myforum/forumdisplay.php?fid=4"><font color=red>→</font> 政经文教</a>'
menu1[2]='<div align="left"><a href="/myforum/forumdisplay.php?fid=5"><font color=red>→</font> 投资理财</a>'
menu1[3]='<div align="left"><a href="/myforum/forumdisplay.php?fid=176"><font color=red>→</font> 马来西亚华语规范</a>'
menu1[4]='<div align="left"><a href="/myforum/forumdisplay.php?fid=186"><font color=red>→</font> 辩论论坛</a>'
menu1[5]='<div align="left"><a href="/myforum/forumdisplay.php?fid=245"><font color=red>→</font> 活动看板</a>'
还有
<a href="/myforum/index.php?gid=2" onMouseover="dropdownmenu(this, event, menu1, '150px')" onMouseout="delayhidemenu()">政经文教</a>
?? |
|
|
|
|
|
|
|
发表于 8-9-2020 05:38 AM
|
显示全部楼层
Thank you
Thanks, you have pointed out some excellent points.
This is actually the kind of information i have been trying to find.
Best regards. |
|
|
|
|
|
|
|
发表于 9-9-2020 04:09 PM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|