常用的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,%20document.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语言欢迎关注

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: