View Mode: Normal | Article List
May, 2006 | 1
javascript:|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout
|onkeypress|onkeydown|onkeyup|onerror|onfocus|onload|onresize|onunload|onblur
|meta|input|form|select|textarea|option|object
|onkeypress|onkeydown|onkeyup|onerror|onfocus|onload|onresize|onunload|onblur
|meta|input|form|select|textarea|option|object
Office 2003 ico
[ 2006-05-20 19:00:22 | Author: 振华 ]
引自经典论坛:
一:
作者:flashlizi
Read More...
一:
作者:flashlizi
<table id="tbs" width="300" height="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img id="pic" src="http://pages.blueidea.com/articleimg/2006/02/1219/preview_b01.jpg" width="1024" height="768" /></td>
</tr>
</table>
<script>
var tw=document.getElementById("tbs").width;
var picw=document.getElementById("pic").width;
var pich=document.getElementById("pic").height;
if(picw>=tw) {
document.getElementById("pic").width=tw;
document.getElementById("pic").height=(tw/picw)*pich;
...<tr>
<td><img id="pic" src="http://pages.blueidea.com/articleimg/2006/02/1219/preview_b01.jpg" width="1024" height="768" /></td>
</tr>
</table>
<script>
var tw=document.getElementById("tbs").width;
var picw=document.getElementById("pic").width;
var pich=document.getElementById("pic").height;
if(picw>=tw) {
document.getElementById("pic").width=tw;
document.getElementById("pic").height=(tw/picw)*pich;
Read More...
getElementById
[ 2006-05-20 18:13:19 | Author: 振华 ]
<script>
function ctf(id){
var temp=document.getElementById(id);//找到input1
temp.innerHTML="我的内容被改变"; //直接改边名为 id 的div的内容
}
</script>
<DIV ID="input1"><b>我是第一</b></div>
<DIV ID="input2"><b>我是第二</b></div>
<a href="#" onclick="ctf('input1')"> 改变一</a>
<a href="#" onclick="ctf('input2')"> 改变二</a>
function ctf(id){
var temp=document.getElementById(id);//找到input1
temp.innerHTML="我的内容被改变"; //直接改边名为 id 的div的内容
}
</script>
<DIV ID="input1"><b>我是第一</b></div>
<DIV ID="input2"><b>我是第二</b></div>
<a href="#" onclick="ctf('input1')"> 改变一</a>
<a href="#" onclick="ctf('input2')"> 改变二</a>
1












