常用的js腳本代碼,節省你的開發時間,就是你想要的效果
46、
<a href="javascript:window.close()">關閉窗口</a>
<a href="#" onClick=window.close();return false)>關閉窗口</a>
<a href="#" onClick=setTimeout(window.close(),3000)>3秒關閉本窗口</a>
<script>
function shutwin(){
window.close();
return;}
</script>
<a href="javascript:shutwin();">關閉本窗口</a>
47、<SPAN onClick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.winliuxq.com/');" style="CURSOR: hand">設為首頁</SPAN>
48、等於標題欄:<script>document.write(document.title);</script>
49、
<a href="javascript:void(0);" onClick='window.external.AddFavorite(location.href, document.title);'>收藏本頁</a>
<a href="javascript:window.external.AddFavorite(document.location.href, document.title)">收藏本頁</a>
<a href=javascript:window.external.addChannel("typhoon.cdf")>加入頻道</a>
50、
<a href="i003.htm" onclick="return false;" ondblclick="window.open('i003.htm');">雙擊打開鏈接</a>
51、
<style>#close a:hover {background:url(javascript:window.opener=0;window.close());}</style><div id=close><a href="">關閉窗口</a></div>
52、
<A HREF="javascript:void(0)" onMouseover="alert('對不起,禁止選中!')">鏈接禁止</A>
53、滾動條在左側,將<html>改為<HTML DIR="RTL">
54、網頁半透明
<body style="filter:Alpha(Opacity=50)">
55、隨機選擇背景色
<body>
<script>
document.body.style.background=(["red","blue","pink","navy","gray","yellow","green","purple"])[parseInt(Math.random()*8)];
</script>
每天持續分享關於編程的小知識,java,php,c語言歡迎關注