1、忽視右鍵
<body"return false">或<body style="overflow-y:hidden">
2、加入背景音樂
IE:<bgsound src="*.mid" loop=infinite>
NS:<embed src="*.mid" autostart=true hidden=true loop=true>
</embed>
*.mid你的背景音樂的midi格式文件
3、簡單的window.open方法
<a href="#"
onclick="javascript:window.open(文件路徑/文件名,newwindow,
toolbar=no,scrollbars=yes,resizable=no,top=0,left=0,
width=400,height=300);">文字或圖片</a>
參數解釋:
<script LANGUAGE="javascript"> js腳本開始;
window.open 彈出新窗口的命令;
文件路徑/文件名 彈出窗口的文件名;
newwindow 彈出窗口的名字(不是文件名),非必須,可用空代替;
width=400 窗口寬度;
height=300 窗口高度;
top=0 窗口距離屏幕上方的象素值;
left=0 窗口距離屏幕左側的象素值;
toolbar=no 是否顯示工具欄,yes為顯示;
menubar,scrollbars 表示菜單欄和滾動欄。
resizable=no 是否允許改變窗口大小,yes為允許;
location=no 是否顯示地址欄,yes為允許;
status=no 是否顯示狀態欄內的信息(通常是文件已經打開),yes為允許;
</script> js腳本結束
4、簡單的頁面加密
<script LANGUAGE="javascript">
<!--
function loopy(){
var sWord ="";
while(sWord!="login"){sWord=prompt("請輸入你的登陸密碼");}
alert("登陸成功!");}
loopy()
//-->
</script>
5、拉動頁面時背景圖不動
<style>
body{background-image:url(logo.gif);
background-repeat:no-repeat;background-position:center}
</style>
6、讓瀏覽器在保存頁面時保存失敗
<NOscript><iframe src="*.html"></iframe></NOscript>
7、隨機替換圖片
<script>
document.write(<img src="img/+parseInt(Math.random()*(5))
+.gif"height="40" width="50">)
</script>
圖片文件名為0.gif 1.gif 2.gif 3.gif 4.gif
8、窗口定時關閉
先將如下代碼網頁文件的區:
<script language="javascript">
function closeit() { setTimeout("self.close()",10000) //毫秒 }
</script>
然后再在<body>標內加入如:<body"closeit()">
9、網頁自動關閉
<html>
<head>
<object id=closes type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
</head>
<body"window.setTimeout(closes.Click(),10000)">
這個窗口會在10秒過后自動關閉,而且不會出現提示.
</body>
</html>
10、網頁自動刷新
在head部記入
<meta HTTP-EQUIV="Refresh" content="20">
其中20為20秒后自動刷新,你可以更改為任意值。
11、網頁自動轉頁
<meta HTTP-EQUIV="Refresh" ConTENT="時間(秒);URL=地址">
12、保持layer在最前面,而不被Iframe、Object所覆蓋
在Layer中再插Iframe 或 Object 設z-Index值
<div z-Index:2><object xxx></object> # 前面
<div z-Index:1><object xxx></object> # 后面
<div id="Layer2" style="position:absolute; top:40;width:400px;
height:95px;z-index:2"> height=100% width=100%>
<iframe width=0 height=0></iframe>
</div>
<div id="Layer1" style="position:absolute; top:50;width:200px;
height:115px;z-index:1">
<iframe height=100% width=100%></iframe>
</div>
13、返回上一頁
<a href=javascript:history.back(1)>『返回上一頁』</a>
14、關閉窗口
<a href=javascript:self.close()>『關閉窗口』</a>
15、關于iframe的透明背景
<Iframe ID="iframe1" SRC="iframe.htm"
allowTransparency="true"
style="background-color: green"></Iframe>
<body"return false">或<body style="overflow-y:hidden">
2、加入背景音樂
IE:<bgsound src="*.mid" loop=infinite>
NS:<embed src="*.mid" autostart=true hidden=true loop=true>
</embed>
*.mid你的背景音樂的midi格式文件
3、簡單的window.open方法
<a href="#"
onclick="javascript:window.open(文件路徑/文件名,newwindow,
toolbar=no,scrollbars=yes,resizable=no,top=0,left=0,
width=400,height=300);">文字或圖片</a>
參數解釋:
<script LANGUAGE="javascript"> js腳本開始;
window.open 彈出新窗口的命令;
文件路徑/文件名 彈出窗口的文件名;
newwindow 彈出窗口的名字(不是文件名),非必須,可用空代替;
width=400 窗口寬度;
height=300 窗口高度;
top=0 窗口距離屏幕上方的象素值;
left=0 窗口距離屏幕左側的象素值;
toolbar=no 是否顯示工具欄,yes為顯示;
menubar,scrollbars 表示菜單欄和滾動欄。
resizable=no 是否允許改變窗口大小,yes為允許;
location=no 是否顯示地址欄,yes為允許;
status=no 是否顯示狀態欄內的信息(通常是文件已經打開),yes為允許;
</script> js腳本結束
4、簡單的頁面加密
<script LANGUAGE="javascript">
<!--
function loopy(){
var sWord ="";
while(sWord!="login"){sWord=prompt("請輸入你的登陸密碼");}
alert("登陸成功!");}
loopy()
//-->
</script>
5、拉動頁面時背景圖不動
<style>
body{background-image:url(logo.gif);
background-repeat:no-repeat;background-position:center}
</style>
6、讓瀏覽器在保存頁面時保存失敗
<NOscript><iframe src="*.html"></iframe></NOscript>
7、隨機替換圖片
<script>
document.write(<img src="img/+parseInt(Math.random()*(5))
+.gif"height="40" width="50">)
</script>
圖片文件名為0.gif 1.gif 2.gif 3.gif 4.gif
8、窗口定時關閉
先將如下代碼網頁文件的區:
<script language="javascript">
function closeit() { setTimeout("self.close()",10000) //毫秒 }
</script>
然后再在<body>標內加入如:<body"closeit()">
9、網頁自動關閉
<html>
<head>
<object id=closes type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
</head>
<body"window.setTimeout(closes.Click(),10000)">
這個窗口會在10秒過后自動關閉,而且不會出現提示.
</body>
</html>
10、網頁自動刷新
在head部記入
<meta HTTP-EQUIV="Refresh" content="20">
其中20為20秒后自動刷新,你可以更改為任意值。
11、網頁自動轉頁
<meta HTTP-EQUIV="Refresh" ConTENT="時間(秒);URL=地址">
12、保持layer在最前面,而不被Iframe、Object所覆蓋
在Layer中再插Iframe 或 Object 設z-Index值
<div z-Index:2><object xxx></object> # 前面
<div z-Index:1><object xxx></object> # 后面
<div id="Layer2" style="position:absolute; top:40;width:400px;
height:95px;z-index:2"> height=100% width=100%>
<iframe width=0 height=0></iframe>
</div>
<div id="Layer1" style="position:absolute; top:50;width:200px;
height:115px;z-index:1">
<iframe height=100% width=100%></iframe>
</div>
13、返回上一頁
<a href=javascript:history.back(1)>『返回上一頁』</a>
14、關閉窗口
<a href=javascript:self.close()>『關閉窗口』</a>
15、關于iframe的透明背景
<Iframe ID="iframe1" SRC="iframe.htm"
allowTransparency="true"
style="background-color: green"></Iframe>
樂發網超市批發網提供超市貨源信息,超市采購進貨渠道。超市進貨網提供成都食品批發,日用百貨批發信息、微信淘寶網店超市采購信息和超市加盟信息.打造國內超市采購商與批發市場供應廠商搭建網上批發市場平臺,是全國批發市場行業中電子商務權威性網站。
本文來源: 淘寶網店裝修效果代碼集合