iframe 에서 스크롤 탑을 구할수 있는가? 구할 수 있다. :)
iframe javascript
function listener(event){
self.scrollTop = event.data;
console.log('Message Received : '+event.data);
}
parent script
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>
<script type="text/javascript">
var win = document.getElementById("myIframe").contentWindow;
$(window).scroll(function(){
var wintop = $(window).scrollTop();
win.postMessage($(window).scrollTop(), 'http://localhost:4000');
});
</script>
참고
http://stackoverflow.com/questions/24656292/jquery-accessing-parent-document-scrolltop-from-iframe-and-sop