ITeye博客

让网页内容不可以复制和滚动条样式

bepatient · 2011-02-06 20:27 · div+css+js · Web前端 · Markdown

让网页内容不可以复制:

<script>
	document.oncontextmenu =function(){return false;};
	document.onmousedown = function(){return false;};
	document.ondragstart =function(){return false;}; 
	document.onselectstart =function(){return false;};
	document.onselect =function(){return false;}; 
	document.oncopy =function(){return false;};
	document.onbeforecopy =function(){return false;}; 
	document.onmousemove =function(){return false;};
</script>

 

滚动条样式:

body(/html){ 
FONT-SIZE: 12px;
 margin-right:0;
 padding-right:0;
 margin-left:0;
 scrollbar-base-color:#C9EBFF;
 scrollbar-face-color:#C9EBFF;
 scrollbar-track-color:#C9EBFF;
 scrollbar-arrow-color:#0099CD;
 scrollbar-3dlight-color:#0099CD;
 scrollbar-highlight-color:#C9EBFF;
 scrollbar-shadow-color:#0099CD;
 scrollbar-darkshadow-color:#C9EBFF;
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。