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 div id=’popup’
- the .fixedHeader class is something I’m trying have fixed at the top of the div frame.
-
getScrollTop() is a javascript function to return the top value (works)
$(document).on("scroll#popup", '#popup', function(){ alert('scrolling'); $(".fixedHeader").css("position", "relative"); $(".fixedHeader").css("top", getScrollTop()); });
The event is simply
scroll, notscroll#popup.