I'd like the content to be hidden when I first open the page until the button is clicked. Any help?
我希望在我第一次打开页面时隐藏内容,直到单击按钮。有帮助吗?
<script>
$(document).ready(function(){
$("#rooms").click(function(){
$("#rooms_box").show();
});
$("#facilities").click(function(){
$("p").show();
});
$("events").click(function(){
$("p").show();
});
$("#gallery").click(function(){
$("p").show();
});
$("#contact").click(function(){
$("p").show();
});
$("#search").click(function(){
$("p").show();
});
});
</script>
1 个解决方案
#1
1
use it like this
像这样使用它
<script>
$(document).ready(function(){
$("p , #rooms_box").hide(); // instead of this line you can use the css below
$("#rooms").click(function(){
$("#rooms_box").show();
});
$("#facilities, #events , #gallery, #contact ,#search").click(function(){
$("p").show();
});
});
</script>
and its good to use css
和它的好用css
p , #rooms_box{
display : none;
}
#1
1
use it like this
像这样使用它
<script>
$(document).ready(function(){
$("p , #rooms_box").hide(); // instead of this line you can use the css below
$("#rooms").click(function(){
$("#rooms_box").show();
});
$("#facilities, #events , #gallery, #contact ,#search").click(function(){
$("p").show();
});
});
</script>
and its good to use css
和它的好用css
p , #rooms_box{
display : none;
}