1.鼠標移動上去,圖片變亮,移開又變成灰色。改變的是透明度。
<style>
.p1{filter:Alpha(Opacity=20)}
.p2{filter:Alpha(Opacity=100)}
</style>
<a href=http://www.pealand.com/ target=_blank><img src=images/game01.gif border=0 class=p1 onmouseover="this.className='p2'" onmouseout="this.className='p1'"></a>
<a href=http://www.pealand.com/sc target=_blank><img src=images/game04.gif border=0 class=p1 onmouseover="this.className='p2'" onmouseout="this.className='p1'"></a>
<a href=http://bzb.gbq.cn target=_blank><img src=images/game06.gif border=0 class=p1 onmouseover="this.className='p2'" onmouseout="this.className='p1'"></a>
<a href=http://www.pealand.com/myroom/edit.htm target=_blank><img src=images/game02.gif border=0 class=p1 onmouseover="this.className='p2'" onmouseout="this.className='p1'"></a>
2.怎樣在網頁中播放mp3格式音樂
<html>
<title></title>
<body>
<embed src="</body>
</html>
詳細說明:
<embed
src="xx.mp3" 音樂文件
loop=false 是否重復播放
autostart=true 是否自動開始
name=bgss 為了控制而設定的名字
width="0" height="0" 寬、高
>
3.滾動現實公告
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr style="text-align: center;">
<td height="0"> <hr noshade> <p>
<marquee>
<xmp> 事件文字滾動 ——公告</xmp>
</marquee>
</p>
<hr noshade></td>
</tr>
</tbody>
</table>
4.以圖片作為按鈕
<form method="post" action="test.html">
<input type="text" name="textfield">
<input type="text" name="textfield2">
<input type="image" border="0" name="imageField" src="../img/submit.jpg" width="71" height="32" onclick="submit()">
</form>
5.表格中單元格之間分隔線的隱藏方法
其實上面的三個表格都有三行三列,隱藏分隔線的訣竅在于rules,察看這三個表格的源代碼,我們可以看到<TABLE>標簽中都有rules。 它有三個參數(cols,rows,none),當rules=cols時,表格會隱藏縱向的分隔線,這樣我們就只能看到表格的行;當rules=rows時,則 隱藏了橫向的分隔線,這樣我們只能看到表格的列;而當rules=none時,縱向分隔線和橫向分隔線將全部隱藏。
6.表格邊框的隱藏
表格邊框的顯示與隱藏,是可以用frame參數來控制的。請注意它只控制表格的邊框圖,而不影晌單元格。
只顯示上邊框 <table frame=above>
只顯示下邊框 <table frame=below>
只顯示左、右邊框 <table frame=vsides>
只顯示上、下邊框 <table frame=hsides>
只顯示左邊框 <table frame=lhs>
只顯示右邊框 <table frame=rhs>
不顯示任何邊框 <table frame=void>
7.刷新的不同狀態
非模態刷新父頁面:window.opener.location.reload();
模態刷新父頁面:window.dialogArguments.location.reload();??
window.location.assign('chklogin.asp');
window.location.reload('chklogin.asp');
以后用前者進行刷新吧。后者似乎對FF 不怎么兼容。
8.文字過長,縮略顯示為...
<DIV STYLE="width: 120px; border: 1px solid blue;
overflow: hidden; text-overflow:ellipsis">
<NOBR title="就是比如有一行文字,很長,表格內一行顯示不下.">就是比如有一行文字,很長,表格內一行顯示不下.</NOBR>
</DIV>
9.加入收藏夾通用代碼
<script type="text/javascript">
function addBookmark(title,url)
{
if (window.sidebar)
{
window.sidebar.addPanel(title, url,"");
} else if( document.all )
{
window.external.AddFavorite( url, title);
} else if( window.opera && window.print )
{
return true;
}
}
</script>
頁面使用:<a href=javascript:addBookmark('天極網網頁陶吧','http://homepage.yesky.com/')> 添加到收藏</a>
10.幾種彈出窗口
用戶輸入:var msg=prompt("請輸入密碼:");if(msg == "PKU")? 彈出輸入框。
用戶確定:var IsOk = confirm('ok');
open為打開一個窗口。
11.動態改變 下拉列表的值。
?document.formname.elements[第幾個元素].text = "test";
?eg:
?document.test9_1.elements[0].options[0].text="昆明市";
?當然也可以用,之所以寫出來是因為很多時候,我總是習慣用value,而忽略了text屬性:
?document.getElementById('select').options[0].text="昆明市";
?
12.動態插入表格內容:
document.getElementById('saleAndLost').rows[1].cells
x[1].innerHTML="test";
?
13.播放器代碼
(1)media player代碼:
<DIV>
<OBJECT id=videowindow1 height=185 width=179 classid=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6>
<PARAM NAME="URL" VALUE="<PARAM NAME="playCount" VALUE="infinite">
<PARAM NAME="autoStart" VALUE="1">
<PARAM NAME="volume" VALUE="50">
<PARAM NAME="uiMode" VALUE="full">
<PARAM NAME="stretchToFit" VALUE="1">
</OBJECT>
</DIV>
?
其中改變這個地址也就改變了你的歌曲
(2)WMP播放器
<embed src="影音文件地址" width="播放器寬" height="播放器高" autostart="true" loop="true" align="middle" volume="200" type="audio/x-pn-realaudio-plugin" exts="ra,ram" Init fn="load-types" mime-types="mime.types" ALT="(Random)"></embed>