佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 5306|回复: 7

论坛header如何弄一个hyperlink

[复制链接]
发表于 15-11-2005 07:16 PM | 显示全部楼层 |阅读模式
好像佳礼的上面
不是有

政经文教 地方州属 人在海外 工作园地 家庭生活 宗教命理 青春广场 影音娱乐 闲情逸致 欢乐校园
美食旅游 体育汽车 医疗保健 电脑网络 工程设计 资讯科技 电玩游戏 人文空间 语文天地 交流建议

上面这些?
我想问问看如何弄呢
以下的代码我测试过了
但是不会出现下拉菜单

<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>
回复

使用道具 举报


ADVERTISEMENT

发表于 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>

??
回复

使用道具 举报

Follow Us
发表于 8-9-2020 05:38 AM | 显示全部楼层

Thank you

НЖК ·±нУЪ 15-11-2005 09:34 PM
ХвёцЬПлОТФЪС§ДК±тУЦ№эОТХТХТ

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 | 显示全部楼层
Good post. I agree with the author's sharp point word unscrambler
回复

使用道具 举报


ADVERTISEMENT

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 3-3-2025 10:55 PM , Processed in 0.355430 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表