快速問題。我用自己漂亮的PNG取代了我網站上的按鈕。然後將圖像包裝在提交按鈕標記中。容易嬌小的權利?爲了清楚......Firefox圖片按鈕onmouseover事件不會觸發
<button type='submit' style='border: 0; background: transparent;'>
<[img tag here] />
</button>
然後讓他們感到互動,還有與圖像onmouseover事件略有不同的照明效果的輔助按鈕。一切工作與Chrome瀏覽器很好,但不是與Firefox。爲了記錄,我使用了一些在Firefox中工作的錨定標籤,因此它是特定於提交按鈕的。它看起來像firefox捕捉按鈕節點中的onmouseover事件,並沒有達到圖像標籤。建議?
注意 onmouseover被編碼到html標籤本身。我真的不想將代碼移動到單獨的監聽器(太多的按鈕,這讓我感覺更清潔)。
感謝您的提前預訂!
編輯 對不起 - 想我可能也已經包括了,只是櫃面> _ <'
<button type='submit' style="border: 0; background: transparent;">
<img class='med_button' style='padding:0;margin:0 0 0 -8px;' src='<?php echo base_url().'assets/images/login_indent_green.png'; ?>' alt='login' onmouseover="src='<?php echo base_url().'assets/images/login_indent_green_hover.png'; ?>'" onmouseout="src='<?php echo base_url().'assets/images/login_indent_green.png'; ?>'" />
</button>
哪裏是簡單易懂的代碼;)? – 2012-07-29 20:14:02
對不起。它現在在那裏。 – dgeare 2012-07-29 20:27:56