So I’ve got a DIV (a map) that goes across the width of the page, but i’d like to have a button users can click to “Hide/Unhide” the DIV that will basically do three things when clicked:
- scale the vertical height of the div to 25% of the original height…
- Change the DIV to have opacity .3 so its faded when at its reduced height…
- Revert back to normal height & opacity (1) when clicked again
Here’s what I’ve got so far: Currently it only scales down to the correct vertical height
Really appreciate the help…
<!-- JQUERY STUFF ADDED IN THE HEAD-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<!-- THE CODE -->
<div id="map">
Map Content Is Here
</div>
<p class="hidemap">HIDE MAP</p>
<script>
$(document).ready(function() {
$("p.hidemap").click(function () {
$("#map").effect("scale", { percent: 25, direction: 'vertical' }, 500);
});
});
</script>
Try something like this:
Working example: http://jsfiddle.net/X4NaV/