I have this 'magicbar' nav, that I wish to keep hidden until the user scrolls past the intro div (where that div goes off screen). I took my JQuery from this SO question here as well as replacing the '>=' with '==', like this SO question here.
I actually tried just telling the browser to set an alert that I had reached the end of the div, but that doesn't work either. I also tried moving the hidden div to the middle of the page in case the event was firing and it was 'showing' off screen. jQuery is loaded on the page, and it hides the div successfully, so the first part of the script is working. It's the meat n potatoes that are nonfunctional. Being a jQuery noob, I do not understand why this doesn't work.
Here is my code:
<script>
$("#magicnav").hide();
jQuery(function ($) {
$('#intro').bind('scroll', function () {
if ($(this).scrollTop() + $(this).innerHeight() == $(this).scrollHeight){
$("#magicnav").show();
}
});
});
</script>
**UPDATE Here is a jsfiddle of the problem.