控制某些元素内容不可复制:

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";
    }
}

posted on 2010-10-08 14:45 -274°C 阅读(268) 评论(0)  编辑  收藏 所属分类: web前端

只有注册用户登录后才能发表评论。


网站导航:
 

常用链接

留言簿(21)

随笔分类(265)

随笔档案(242)

相册

JAVA网站

关注的Blog

搜索

  •  

积分与排名

  • 积分 - 909069
  • 排名 - 40

最新评论