有人可以帮我简化我的完整工作脚本,至少我写的是交换图像吗?
就这个:
<img id="swap_green_img" onMouseOver="swapGreen()" onMouseOut="swapOrigGreen()" onclick="window.open('http://www.stackoverflow.com', '_blank')" style="position:relative; z-index:999; float:left; margin-right:10px; cursor:pointer; height:25px; width:30px" src="facebook_like_icon_orig_50x43.png" width="30" alt="" border="0" />
<img id="swap_red_img" onMouseOver="swapRed()" onMouseOut="swapOrigRed()" onclick="window.open('http://www.stackoverflow.com', '_blank')" style="position:relative; z-index:999; float:left; margin-right:10px; cursor:pointer; height:25px; width:30px;" src="facebook_like_icon_orig_50x43.png" width="30" alt="" border="0" />
<script type="text/javascript">
function swapGreen() {
document.getElementById("swap_green_img").src='facebook_like_icon_green_50x43.png';
}
function swapRed() {
document.getElementById("swap_red_img").src='facebook_like_icon_red_50x43.png';
}
function swapOrigRed() {
document.getElementById("swap_red_img").src='facebook_like_icon_orig_50x43.png';
}
function swapOrigGreen() {
document.getElementById("swap_green_img").src='facebook_like_icon_orig_50x43.png';
}
</script>
首先十分感谢!托尔斯滕