code
/** * 取得 HTML 物件 * @param name * @return obj * Build Date: 2007-12-25 */ function getObject(name) { if (document.getElementById) { obj = document.getElementById(name); } else if (document.all) { obj = document.all[name]; } else if (document.layers) { obj = document.layers[name]; } return obj; } /** * on mouse over or out, replace the image * @param id: image ID * @param status: OVER:when mouse over OUT:when mouse out * @param imgOver: when mouse over, 欲置換的圖片 * @param imgOut: when mouse out, 欲置換的圖片 */ function onMouseChgColor(id, status, imgOver, imgOut) { var imgID = getObject(id); switch (status) { case "OVER": imgID.src = imgOver; break; case "OUT": imgID.src = imgOut; break; } }
沒有留言:
張貼留言