So,I have two iframes, one which is designated as “showframe” and represents a huge map:
<iframe src="map.xhtml" width="100%" height="400" name="showframe
The other one contains list of all locations, which uses JS to center the first iframe on given coordinates on that map:
<a class="locind" href="javascript:window.scroll(630,820);" target ="showframe"> Location A</a>
The point is, it works perfectly in FireFox, however, chrome doesn’t seem to be able to detect targeted frame, and centers itself instead. I googled and searched around, and found this:
<script>
function myScroll(id, x, y) {document.getElementById(id).contentWindow.scroll(x, y);
}
</script>
<a class="locind" href="javascript:myScroll('showframe', 630,820);" >Hotel Bosna</a>
But this doesn’t do anything when I click on the link, and I’ not sure why… Anyway, if you can find the problem with the second code, or have a better solution, please, enlighten me 🙂
Please try
or
assuming
If you have id=”showframe” please try