Skip to content

Instantly share code, notes, and snippets.

@kshoufer
Created December 1, 2012 16:16
Show Gist options
  • Save kshoufer/4183072 to your computer and use it in GitHub Desktop.
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
<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