注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 DOS命令杀掉进程
 帮助

网页设计常用代码(一)


2005-10-08 17:58:24
 标签:代码 网页设计   [推送到技术圈]

1、禁止页面正文内容被选取
<body oncontextmenu="return false" ondragstart="return false"
onselectstart ="return false" onselect="document.selection.empty()"
oncopy="document.selection.empty()" onbeforecopy="return
false"onmouseup="document.selection.empty()">
2、消除ie6自动出现的图像工具栏,设置 GALLERYIMG属性为false或no .
<IMG SRC="mypicture.jpg" HEIGHT="100px" WIDTH="100px"
GALLERYIMG="no">
……

1、禁止页面正文内容被选取
<body oncontextmenu="return false" ondragstart="return false"
onselectstart ="return false" onselect="document.selection.empty()"
oncopy="document.selection.empty()" onbeforecopy="return
false"onmouseup="document.selection.empty()">
2、消除ie6自动出现的图像工具栏,设置 GALLERYIMG属性为false或no .
<IMG SRC="mypicture.jpg" HEIGHT="100px" WIDTH="100px"
GALLERYIMG="no">
3、防止点击空链接时,页面往往重置到页首端。
代码"javascript :void(null)"代替原来的"#"标记
4、如何避免别人把你的网页放在框架中
<script language="javascript"><!--if (self!=top) --><
/script>

5、页面定时刷新
<meta http-equiv="Refresh" content="秒" >
6、页面定时转向新的地址
<meta http-equiv="refresh" content="秒;URL=url">
7、关闭窗口,这个是不会弹出提示直接关的:
把如下代码加入<body>区域中
<OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
<script language="javascript">function shutwin()</script>
<a href="javascript :shutwin();">关闭本窗口</a>
来源:希赛社区 作者:LX_FLYER




    文章评论
 
 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: