2011-08-26 80 views
1

我對編碼比較陌生,但我已經構建了一個網站:RateMyTeam.co.uk(幻想足球分析),並且遇到與Internet Explorer兼容性問題的一些問題。該網站在Chrome和Safari中完美運行,並且只有Firefox中出現問題。但IE的問題是一個問題,因爲超過30%的訪問者使用IE。在Internet Explorer中切換可見性問題

在主頁上,我使用javascript函數切換可以看到的問題的可見性,例如「什麼是我的FPL ID?」

在Chrome中,它做我想做的事情,當您將鼠標懸停在它上面並且能夠點擊它並顯示問題的答案時,它會改變顏色。

有沒有人有任何想法是什麼是我的主頁代碼是防止可見性切換在IE瀏覽器的錯誤?我已經通過衆多論壇尋找答案,並嘗試了很多東西,但它似乎並沒有工作! :■

感謝,

克里斯

編輯

這裏是代碼:

HTML位:

<h5 style="text-shadow: #111 2px 2px 4px"><a2 href="#" onclick="toggleVisibility('foo6');">*WHAT IS MY FPL PLAYER ID?</a2></h5> 

<div id="foo6" style="display:none;"><h6 style="margin-top:8px;margin-bottom:13px;color:#ccc">Each person who plays the fantasy football game at <a href="http://www.fantasy.premierleague.com">www.fantasy.premierleague.com</a> gets assigned a unique id. This is a number which can be as small as 1 digit and as big as 7 digits long.</h6></div> 

的JavaScript位:

<script src="http://code.jquery.com/jquery-latest.js"></script> 
<script type="text/JavaScript"> 
    function toggleVisibility(id) { 
     var e = document.getElementById(id); 
     if(e != null) { 
      if(e.style.display == 'none') { 
       e.style.display = 'block'; 
      } else { 
       e.style.display = 'none'; 
      } 
     } 
    } 
</script> 
+0

你有任何代碼可以告訴我們嗎? – Colin

+0

對不起應該添加代碼。我編輯了以前的消息。 – Chris

+0

什麼是 Toto

回答

0

是的,你應該只有使用有效的HTML(4/5)標籤。如果你需要使用不同的css作爲相同類型的元素,你應該使用CSS類。在這裏獲取更多信息:http://tizag.com/cssT/class.php