PDA

查看完整版本 : 網頁代碼特效求助


668
2013-04-28, 08:23 AM
<STYLE type=text/css>
A:link {COLOR: #007500; TEXT-DECORATION: none}
A:visited {COLOR: #007500; TEXT-DECORATION: none}
A:hover {COLOR: #800080; TEXT-DECORATION: none}
#ie5menu { BACKGROUND-COLOR: #d6e7e7; BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; CURSOR: default; FONT-FAMILY: Verdana; FONT-SIZE: 8pt; LINE-HEIGHT: 17px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 120px}
..menuitems { PADDING-LEFT: 15px; PADDING-RIGHT: 15px}
</STYLE>


<SCRIPT language=JavaScript1.2>
var display_url=0

function showmenuie5(){
ie5menu.style.left=document.body.scrollLeft+event.clientX
ie5menu.style.top=document.body.scrollTop+event.clientY
ie5menu.style.visibility="visible"
return false
}

function hidemenuie5(){
ie5menu.style.visibility="hidden"
}

function highlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor="highlight"
event.srcElement.style.color="white"
if (display_url==1)
window.status=event.srcElement.url
}
}

function lowlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor="#D6E7E7"
event.srcElement.style.color="black"
window.status=''
}
}

function jumptoie5(){
if (event.srcElement.className=="menuitems")
window.location=event.srcElement.url
}
</SCRIPT>

<DIV id=ie5menu onclick=jumptoie5() onmouseout=lowlightie5()
onmouseover=highlightie5()>
<DIV class=menuitems url="http://www.domainclub.org">網域名稱俱樂部</DIV>
<DIV class=menuitems url="http://tw.yahoo.com">Yahoo</DIV>
<DIV class=menuitems url="http://www.0204.net">免費視訊</DIV>
<HR>
<DIV class=menuitems
onclick="window.external.addFavorite('http://www.domainclub.org','網域名稱俱樂部') ;"
url="javascript:history.go(0)">加入我的最愛</DIV></DIV>
<SCRIPT language=JavaScript1.2>
document.oncontextmenu=showmenuie5
if (document.all&&window.print)
document.body.onclick=hidemenuie5
</SCRIPT>


這個代碼特效可以自訂右鍵連結內容
如果更改內碼使其連結為開新視窗
請高手解答~yes

wufenpu
2013-04-28, 09:23 AM
像這樣?


<STYLE type=text/css>
A:link {COLOR: #007500; TEXT-DECORATION: none}
A:visited {COLOR: #007500; TEXT-DECORATION: none}
A:hover {COLOR: #800080; TEXT-DECORATION: none}
#ie5menu { BACKGROUND-COLOR: #d6e7e7; BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; CURSOR: default; FONT-FAMILY: Verdana; FONT-SIZE: 8pt; LINE-HEIGHT: 17px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 120px}
..menuitems { PADDING-LEFT: 15px; PADDING-RIGHT: 15px}
</STYLE>


<SCRIPT language=JavaScript1.2>
var display_url=0

function showmenuie5(){
ie5menu.style.left=document.body.scrollLeft+event.clientX
ie5menu.style.top=document.body.scrollTop+event.clientY
ie5menu.style.visibility="visible"
return false
}

function hidemenuie5(){
ie5menu.style.visibility="hidden"
}

function highlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor="highlight"
event.srcElement.style.color="white"
if (display_url==1)
window.status=event.srcElement.url
}
}

function lowlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor="#D6E7E7"
event.srcElement.style.color="black"
window.status=''
}
}

function jumptoie5(){
if (event.srcElement.className=="menuitems")
window.location=event.srcElement.url
}
</SCRIPT>

<DIV id=ie5menu onclick=jumptoie5() onmouseout=lowlightie5()
onmouseover=highlightie5()>
<DIV class=menuitems onclick="window.open('http://www.dinner.tw','new_window');" >料理美食通</DIV>
<DIV class=menuitems onclick="window.open('http://www.domainclub.org','new_window');" >網域名稱俱樂部</DIV>
<DIV class=menuitems onclick="window.open('http://tw.yahoo.com','new_window');" >Yahoo</DIV>
<DIV class=menuitems onclick="window.open('http://www.0204.net','new_window');" >免費視訊</DIV>
<HR>
<DIV class=menuitems
onclick="window.external.addFavorite('http://www.domainclub.org','網域名稱俱樂部') ;"
url="javascript:history.go(0)">加入我的最愛</DIV></DIV>
<SCRIPT language=JavaScript1.2>
document.oncontextmenu=showmenuie5
if (document.all&&window.print)
document.body.onclick=hidemenuie5
</SCRIPT>

668
2013-04-28, 05:25 PM
十分感謝...
但是原來的網頁卻連不上
桌面\undefined
你的會不會這樣?

668
2013-04-28, 08:25 PM
可以了..
:bow
<STYLE type=text/css>
A:link {COLOR: #007500; TEXT-DECORATION: none}
A:visited {COLOR: #007500; TEXT-DECORATION: none}
A:hover {COLOR: #800080; TEXT-DECORATION: none}
#ie5menu { BACKGROUND-COLOR: #d6e7e7; BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; CURSOR: default; FONT-FAMILY: Verdana; FONT-SIZE: 10pt; LINE-HEIGHT: 18px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 150px; PADDING-LEFT: 10px; PADDING-RIGHT: 10px}

</STYLE>


<SCRIPT language=JavaScript1.2>
var display_url=0

function showmenuie5(){
ie5menu.style.left=document.body.scrollLeft+event.clientX
ie5menu.style.top=document.body.scrollTop+event.clientY
ie5menu.style.visibility="visible"
return false
}

function hidemenuie5(){
ie5menu.style.visibility="hidden"
}

function highlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor="highlight"
event.srcElement.style.color="white"
if (display_url==1)
window.status=event.srcElement.url
}
}

function lowlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor="#D6E7E7"
event.srcElement.style.color="black"
window.status=''
}
}

function jumptoie5(){
if (event.srcElement.className=="menuitems")
window.location=event.srcElement.url
}
</SCRIPT>

<DIV id=ie5menu onclick=jumptoie5() onmouseout=lowlightie5()
onmouseover=highlightie5()>
<DIV onclick="window.open('http://www.dinner.tw','new_window');" >料理美食通</DIV>
<DIV onclick="window.open('http://www.domainclub.org','new_window');" >網域名稱俱樂部</DIV>
<DIV onclick="window.open('http://tw.yahoo.com','new_window');" >Yahoo</DIV>
<DIV onclick="window.open('http://www.0204.net','new_window');" >免費視訊</DIV>
<HR>

<DIV class=menuitems
onclick="window.external.addFavorite('http://www.domainclub.org','網域名稱俱樂部') ;"
url="javascript:history.go(0)">加入我的最愛</DIV></DIV>
<SCRIPT language=JavaScript1.2>
document.oncontextmenu=showmenuie5
if (document.all&&window.print)
document.body.onclick=hidemenuie5
</SCRIPT>

wufenpu
2013-04-28, 09:40 PM
......~yes