function close(input) { } $(function() { $("#closea").click(function() { if ($(this).hasClass("closea")) { $(this).removeClass("closea"); $("#closeimg").attr("src", "https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_up_48px-512.png"); } else { $(this).addClass("closea"); $("#closeimg").attr("src", "https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png"); } $("#closediv").slideToggle("slow"); }); }); .close{ text-align: ; position: fixed; bottom: 0px; right: 0px; width: 40%; background: rgb(80, 80, 80); } .close:hover{ } #closediv{ } #closediv:hover{ } #closea{ background: rgba(80, 80, 80, 0.7) !important; cursor: pointer; text-align: center; display: block; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class='close'> <div> <a id='closea' onclick="close(this)" class="closea"> <img id='closeimg' src="https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png" style="width:30px"> </a> </div> <div id='closediv'> content content content content content content content content content content content content content content </div> </div> How to make a block was originally open and when the page loads it closes up. and every 15 seconds the unit opened slightly but did not open. as if reminding myself