$(document).ready(function(){ $('.zubr').click(function(){ var show = $('.mobile-head'); if(show.css('display', 'none')){ show.show('1000') } else{ show.hide('1000') } }) }); .mobile-head{ width: 100px; height: 100px; background-color: red; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="mobile-head">z</div> <button class="zubr">Click me</button> The usual animation does not work, the button and the block itself, when pressed, the block should be hidden if it is shown, and show if it is hidden. But only 1 condition works. Why?
if ( show.css('display') == 'none' ) { }- Mikhail Rebrov