Reputation: 805
I'm having a parallax effect inside an iFrame. Because I'd like to avoid double scroll bars, the iFrame is automatically resized to it's actual height.
However, the parallax won't work anymore, because the $(window).scrollTop()
will always be 0
inside the iFrame.
Is it possible to scrollspy on an iFrame's parent?
Here is a very simplified snippet:
Inside the iFrame is a script which needs to get the .scrollTop()
of $('.get-scroll')
<body class="get-scroll">
<div class="stuff">
...
</div>
<iframe>
<script>
//do some magic
</script>
</iframe>
<div class="other-stuff">
...
</div>
</body>
Upvotes: 1
Views: 220