2012-05-08 10 views
0

Safariで表示/非表示に問題があるようです。サイトは新しく読み込まれたように見えます。しかし、左隅の最初のリンクをクリックして戻るよりも、表示/非表示機能がうまく機能せず、レイヤーを重ね合わせることができます。注:この問題はSafariでのみ発生します。SafariでJavascriptの表示/非表示が正しく非表示にならない

私はjQueryのを使用しましたし、ここに私のショーの非表示コードは次のとおりです。サイトへ

<script type="text/javascript"> 
    function show(id) { 
    document.getElementById(id).style.visibility = "visible"; 
    } 
    function hide(id) { 
    document.getElementById(id).style.visibility = "hidden"; 
    } 
</script> 

リンク:http://www.smudesign2012.co.uk/

enter image description here

答えて

0

私はあなたが要素を非表示/表示するためにjqueryのを使用することをお勧め。

function show(id){ 
    $('.student').hide(); // hide all students 
    $('#'+id).show(); // show the student with applied ID 
} 

function hide(id){ 
    $('#'+id).hide(); // is this needed? Why not do the next one and skip the parameter to the function? 
    $('.student').hide(); 
} 
+0

の違いに注意してくださいありがとうございました!これはトリックでした。また、ドキュメント上にhideコマンドを追加しましたので、空白になります。再度、感謝します! :D – Eirik

0

この を試してみて、.style.display

<script type="text/javascript"> 
    function show(id) { 
    document.getElementById(id).style.display= ""; 
    } 
    function hide(id) { 
    document.getElementById(id).style.display= "none"; 
    } 
</script> 
関連する問題