網(wǎng)頁(yè)編程常用技巧 收藏
控制橫向和縱向滾動(dòng)條的顯隱?
<body style="overflow-y:hidden"> 去掉x軸
<body style="overflow-x:hidden"> 去掉y軸
<body scroll="no">不顯
--------------------------------------------------------------------------------
表格變色
<TD onmouseover="this.style.backgroundColor='#FFFFFF'"
onmouseout="this.style.backgroundColor=''"
style="CURSOR: hand">
--------------------------------------------------------------------------------
禁止復(fù)制,鼠標(biāo)拖動(dòng)選取
<body ondragstart=window.event.returnValue=false oncontextmenu=window.event.returnValue=false onselectstart=event.returnValue=false>
--------------------------------------------------------------------------------
iframe自適應(yīng)高度
<iframe name="pindex" src="index.asp" frameborder=false scrolling="auto" width="100%" height="100%" frameborder=no onload="document.all['pindex'].style.height=pindex.document.body.scrollHeight" ></iframe>
--------------------------------------------------------------------------------
IE地址欄前換成自己的圖標(biāo)&可以在收藏夾中顯示出你的圖標(biāo)
<link rel="Shortcut Icon" href="favicon.ico">
<link rel="Bookmark" href="favicon.ico">
--------------------------------------------------------------------------------
字號(hào)縮放
越來(lái)越多的人長(zhǎng)時(shí)間的泡網(wǎng),眼鏡的普及率也越來(lái)越高,讓文字大點(diǎn),讓更多的用戶看的更清楚。
<script type="text/javascript">
function doZoom(size)
{document.getElementById('zoom').style.fontSize=size+'px';}
</script>
<span id="zoom">需要指定大小的文字</span>
<a href="javascript:doZoom(16)">大</a> <a href="javascript:doZoom(14)">中</a> <a href="javascript:doZoom(12)">小</a>
--------------------------------------------------------------------------------
select擋住div的解決方法
在div里加入下面的代碼,根據(jù)需要調(diào)整就可以了。
<iframe src="javascript:false" scrolling="no" frameborder="0" style="z-index:-1;position:absolute; top:5px; left:2px;width:168;height:100px;">
</iframe>
--------------------------------------------------------------------------------
讓IFRAME框架內(nèi)的文檔的背景透明
<iframe src="about:<body style='background:transparent'>" allowtransparency></iframe>
--------------------------------------------------------------------------------
打開窗口即最大化
<script language="JavaScript">
<!-- Begin
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
// End -->
</script>
--------------------------------------------------------------------------------
加入背景音樂
<bgsound src="mid/windblue[1].mid" loop="-1"> 只適用于IE
<embed src="music.mid" autostart="true" loop="true" hidden="true"> 對(duì)Netscape ,IE 都適用
--------------------------------------------------------------------------------
滾動(dòng)
<marquee direction=up height=146 onmouseout=start() onmouseover=stop() scrollAmount=2>滾動(dòng)信息
</marquee>
--------------------------------------------------------------------------------
防止點(diǎn)擊空鏈接時(shí),頁(yè)面往往重置到頁(yè)首端
代碼“javascript:void(null)”代替原來(lái)的“#”標(biāo)記 分類:網(wǎng)頁(yè)編輯 | 固定鏈接 | 評(píng)論: 0 | 引用: 0 | 查看次數(shù): 37
打開任意網(wǎng)頁(yè)(只要這個(gè)網(wǎng)頁(yè)有圖片)把地址欄地址改為下面的代碼,你會(huì)有驚喜的作者:wuyilala 日期:2006-10-11
打開任意網(wǎng)頁(yè)(只要這個(gè)網(wǎng)頁(yè)有圖片)
把地址欄地址改為下面的代碼,你會(huì)有驚喜的
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position="absolute"; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5); void(0);
查看更多...
分類:網(wǎng)頁(yè)編輯 | 固定鏈接 | 評(píng)論: 0 | 引用: 0 | 查看次數(shù): 52
今天自己搞了個(gè)判斷頁(yè)面然后跳轉(zhuǎn)的代碼,覺得不錯(cuò),保存下~現(xiàn)在404設(shè)置一個(gè)就行了~挺方便的作者:wuyilala 日期:2006-09-14
今天自己搞了個(gè)判斷頁(yè)面然后跳轉(zhuǎn)的代碼,覺得不錯(cuò),保存下~現(xiàn)在404設(shè)置一個(gè)就行了~挺方便的
程序代碼
<script Language="JavaScript">
<!--
refreshurl = location.hostname;
document.write(refreshurl);
document.write("<meta http-equiv=refresh content='1;url=http://",refreshurl,"'>");
//-->
</script>
Location Properties
Properties Description JS IE NS OP FF KQ SF
hash 錨點(diǎn),即#及其后面的錨點(diǎn) 1.0 3.0 2.0 7.1 1.0 3.3 1.2
host 主機(jī)名稱+端口號(hào) 1.0 3.0 2.0 5.12 1.0 3.3 1.2
hostname 主機(jī)名稱 1.0 3.0 2.0 5.12 1.0 3.3 1.2
href url完整地址 1.0 3.0 2.0 7.1 1.0 3.3 1.2
pathname 路徑 1.0 3.0 2.0 7.1 1.0 3.3 1.2
port 端口 1.0 3.0 2.0 7.1 1.0 3.3 1.2
protocol 協(xié)議 1.0 3.0 2.0 7.1 1.0 3.3 1.2
search 搜索條件,即?及其后的參數(shù)字串 1.0 3.0 2.0 7.1 1.0 3.3 1.2
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)
點(diǎn)擊舉報(bào)。