So, here\'s the problem: I have a quite long page with an iframe in the middle. Now, if an anchor is clicked in the iframe, the entire page is scrolled to the iframe, which is w
Yes, you have to watch the links and do it using JQuery.
$(document).on('click', 'A[href^="#"]', function(){
var hash = $(this).attr('href');
var o = $(hash);
if (o.length) {
// move it
$("html,body").stop().animate({ scrollTop: o.offset().top }, 300, 'swing');
if (window.frameElement) {
// it has parent window => stop bubbling (will not change document location)
return false;
}
}
});