« 於: 四月 01, 2009, 06:00:40 pm »
<script type="text/javascript">
IE = (document.all);
NS = (navigator.appName=="Netscape");
function MoveDiv(id, num){
es=document.getElementById(id).style;
if (IE) {
es.pixelLeft += num;}
if (NS||NS6) {
es.left = parseInt(es.left)+num+"px";}
}
Within IE, you can use the attribute pixelLeft of tag's style to move.
Within Firefox, you MUST use the attribute left instead of pixelLeft.
In addition, the unit "px" must be added after the number.