1
我的代碼看起來像這樣使用Dreamweaver的圖像交換。當onclick事件被激活時禁用onmouseout功能
<a href = "#"> <img src="images/leistungen.png" alt="leistungen" name="leistungen"
width="162" height="38" id="leistungen"
onclick="MM_swapImage('home','','images/home_orig.png','philosophie','', 'images/philosophie.png','kontakt','','images/kontakt.png','body_layout','','images/body_leistungen.png',0)"
onmouseover="MM_swapImage('leistungen','','images/leistungen_onclick.png',1)"
onmouseout="roll()" /></a>
然後我有這個功能
function roll(){
var temp; temp.src = 'images/leistungen_onclick.png';
if(document.leistungen.src == temp.src){return false;}
else {document.leistungen.src = 'images/leistungen.png';}
}
我想滾()函數來檢測是否被點擊或沒有圖像.. 所以我的解決辦法是檢查圖像源是leistungen_onclick巴紐如果沒有則執行的onmouseover功能..
if(document.leistungen.src == temp.src){return false;}
從未執行... 我的問題是..什麼是determi有道ne是圖像的圖像源?或者是否有一個簡單的方法來禁用onmouseover函數執行onclick函數?
非常感謝! Jr 編輯:對不起,我不知道如何使它成爲代碼標記。現在我明白了。
請通過縮進4個空格來重新設置您的代碼段的格式。我會自己做,但我不能編輯其他人的帖子。 – 2010-06-23 00:42:37