滚动的超级链接[网页特效]

王朝html/css/js·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

<html>

<title>knowsky.com</title>

<head>

<script type="text/javascript">

function disableSelection(target){

if (typeof target.onselectstart!="undefined") //IE route

target.onselectstart=function(){return false}

else if (typeof target.style.MozUserSelect!="undefined") //Firefox route

target.style.MozUserSelect="none"

else //All other route (ie: Opera)

target.onmousedown=function(){return false}

target.style.cursor = "default"

}

//Sample usages

//disableSelection(document.body) //Disable text selection on entire body

//disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"

</script>

</head>

<body>

<div id="test" style="background:#f1f1f1;border:1px #000 dotted">这里不能选择</div>

<script type="text/javascript">

var somediv=document.getElementById("test")

disableSelection(somediv) //disable text selection within DIV with id="mydiv"

</script>

</body>

</html>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航