简体   繁体   中英

Sliding panel stays up when opening the page

When I open or refresh a page containing several sliding panels, all the panels have already been slid down. I want them be slid up. Any thoughts? Thanks.

<script> 
$(document).ready(function(){$(".flip1").click(function(){$(".panel1").slideToggle("slow");});});
$(document).ready(function(){$(".flip2").click(function(){$(".panel2").slideToggle("slow");});});
$(document).ready(function(){$(".flip3").click(function(){$(".panel3").slideToggle("slow");});});
</script>

<div class="flip1">Title 1</div>
<div class="panel1">Contect 1 </div>

.slideToggle() changes "display: initial" to "display: none" and vice versa.

CSS

.panel1 {
  display: none;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM