I\'m attempting to use the .on() from jQuery to catch a scroll event that is inside a tag.
so this was my solution:
The event is simply scroll
, not scroll#popup
.
// http://ejohn.org/blog/learning-from-twitter
// Also, be consistent with " vs '
var $fixedHeader = $('.fixedHeader').css('position', 'relative');
$(document).on('scroll', '#popup', function() {
console.log('scrolling'); // you *really* don't want to alert in a scroll
$fixedHeader.css("top", getScrollTop());
});