If when page loads and .scrollbutton is clicked, it checks that .moveup class is visible, if it is then it fires “not hidden” alert.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<script> $(document).ready(function(){ $('.scrollbutton').click(function(){ if ($('.moveup').is(':visible')) { alert ("not hidden"); } else { alert("hidden"); } $('.moveup').slideToggle(); }); }); </script> |