I have a wierd problem with Chrome. I have some “go to no where links”
<a href="#">
that change an iframe content and there are more links in the iframe page.
So my problem is that when I click the “go to no where link” on the page and inside the iframe, Chrome automatically scrolls the link position.
Is there somthing I can do to cancel this effect?
Here is one of the contents of the link that is changing the content of the iframe:
var isChrome = (navigator.userAgent.indexOf("Chrome") >= 0);
function LoadFrame(url) {
var oFrame = document.getElementById("iframeBoxID");
if (isChrome) {
oFrame.style.visibility = "hidden";
oFrame.onload = function () {
oFrame.style.visibility = "visible";
};
}
oFrame.src = url;
}
$("#TestPage1").click(function () {
LoadFrame("../galleryControlTest/TestPage1.aspx");
changeFocusToIframe(this);
});
Is there somthing I can add to the script that will cancel this effect?
In IE and FireFox this doesn’t happen.
Add
return falseto your onlick event.