Created
December 1, 2012 16:16
-
-
Save kshoufer/4183072 to your computer and use it in GitHub Desktop.
jQuery code to detect the HTML content of the button and grow or shrink the popup navigation container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready(function () { | |
$("#btnPopup").click(function () { | |
var div = $("#popup-nav-content"); | |
var btn = $("#btnPopup"); | |
var btnHTML = btn.html(); | |
if (btnHTML == "Show Nav") { | |
btn.html("Hide Nav"); | |
div.css("display", "block"); | |
div.animate({ height: '300px' }, "slow"); | |
} | |
else | |
{ | |
btn.html("Show Nav"); | |
div.animate({ height: '0px' }, "slow"); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment