I have a very long iframe inside my parent page. When you reload or click on a link inside i frame's page it is loaded inside it but the purent window must be scroll up.
I have tried variuos code example:jquery which event is better thatn this and How to scroll parent page with iFrame reload Parent page body code:
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
$('iframe').load(function(){
$(window).scrollTop(0);
});
});</script>
<iframe frameborder="0" height="1000" id="iframe" src="http://mysite.com" width="800"></iframe>
And now this is my final code in parent page: (that doesn't work)
<script type="text/javascript">
$('iframe').ready(function(){
$(window).scrollTop(0);
});
</script>
<iframe frameborder="0" height="1000" id="iframe" align="top" src="http://foicam.altervista.org/listadinamica.php" width="800" ></iframe>
but the problem is that each code scroll up the parent page AFTER the frame is compleately loaded (images include). Whant i want is that the parent page scrolls up BEFORE iframe has finished to load.
if you click on last image or scroll down the page and then reload only iframe you'll see what i mean!
Thanx a lot, and sorry but I discovered the existence of this language iesterday afternoon!!!