2014-03-31 117 views
1

我想在第一次頁面加載時顯示DIV,點擊側欄菜單時我會消失。我自己的代碼是無論何時單擊菜單(頁面重新加載),DIV總是最近出現並消失。JS/jQuery頁面加載時顯示DIV,點擊時隱藏

對不起,我英文不好:d

if (isset($_GET['ex'])) 
{ 
test();       
<script> 
    $("#hello").hide(1000);     
</script> 
} 

回答

1

事情是這樣的:

<?php 
if (isset($_GET['ex'])) { 
test(); 
?> 
<script> 
$(function() { 
    $("#hello").show(); 
    $("#sideBar").click(function() { 
     $('#hello').hide(1000); 
    }); 
}); 
</script> 
<?php 
    } 
?>