After pressing the show I need something, I could click on the .wrapper
container (that is, outside the block districts) and the disappearing effect occurred, as with the second click on show, who knows how to do this?
ATTENTION ! you need this trigger to be able to click after the first click on show. That is, in a hidden state, when you .wrapper
on .wrapper
nothing appears.
Example: http://jsfiddle.net/ad8zr/37/
$(document).ready(function() { $('#triggermap').click(function() { var map = $(".schememap"); map.stop(); if(map.is(':visible')) { map.animate({ right:493, opacity: 0 }, 1200, function() { $(this).hide().css('right', 0); }); } else { map.show().animate({ right:193, opacity: 1 }, 1200);} }); });
.schememap { display: none; height: 234px; margin-top: 50px; opacity: 0; position: absolute; background: blue; right: 0; width: 500px; } #triggermap { border-bottom: 1px dashed; font-size: 20px; color: #0C5394; float: left; } .wrapper { width: 100%; height: 100%; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class='wrapper'> <p id='triggermap'>show</p> <div class="schememap" ></div> </div>
#triggermap
, well, hang it on the elements you need. for example on'.wrapper,.wrapper *'
. - Yura Ivanov