I have a content that I have to display on a page with an iFrame. In the iframe, I have a menu that should be fixed at the top of the page. Because the content in the iFrame is long, I also need to detect the scrollTop position when the users scrolls. I'm using
$(window).scroll(function() {
.....
});
to detect the scrolling and
var topOffset = $(window).scrollTop();
to detect the scroll position. The problem is that all of this is working on every device (PC, Mac, Android), but not on iPhone or iPad. The menu with position fixed is not fixed (it's gone the moment I scroll) and topOffset is always 0 ($(window).scroll is not even firing). The iFrame is inside a div with -webkit-overflow-scrolling: touch property.