To who interested on change on fly before 1.6.6 as definitive scroll fix, the changes to do are just these two steps:
1) Open your overall_footer.html file and substitute/replace the old added wp_w3all code with this new code:
Code: Select all
<script type="text/javascript">
// TO ACTIVATE phpBB lightbox events remove /* and */ here below
/*
$(document).on('mouseup', '.postimage', function(){
//var w3allappend = "getw3all_lightbox";
if ('parentIFrame' in window) window.parentIFrame.scrollToOffset(0,0);
//if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
*/
$(document).on("click", "a", function() {
var href = $(this).attr("href");
var w3allappend = href;
var w3all_onview_topic = (href.indexOf('viewtopic.php') > -1);
var w3all_onview_attach = (href.indexOf('file.php') > -1);
var w3all_onview_post = /#p[0-9]+/ig.exec(href);
var w3all_ck_quickmod = (href.indexOf('quickmod') > -1);
if ( w3all_ck_quickmod == true || w3all_onview_topic == false && w3all_onview_attach == false && w3all_onview_post == null ) {
if ('parentIFrame' in window) window.parentIFrame.scrollToOffset(0,0);
}
if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
$(document).on('click', '.quick-login', function(){
var w3allappend = "phpbb_quick_login";
if ('parentIFrame' in window) window.parentIFrame.scrollToOffset(0,0);
if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
$('form').on('submit', function() {
var href = $(this).attr("action");
var ckr = (href.indexOf('#preview') > -1);
if(ckr == true){
var w3allappend = href;
if ('parentIFrame' in window) window.parentIFrame.scrollToOffset(0,0);
if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
}
});
</script>
<script type="text/javascript" src="iframeResizer.contentWindow.min.js" defer></script>
now open page-forum.php and search for this code:
Code: Select all
window.scrollTo(0, 200);
Code: Select all
//window.scrollTo(0, 200);
Code: Select all
// avoid scroll, for certain actions
var w3all_onview_topic = (w3all_passed_url.indexOf('viewtopic.php') > -1);
var w3all_onview_attach = (w3all_passed_url.indexOf('file.php') > -1);
var w3all_onview_post = /#p[0-9]+/ig.exec(w3all_passed_url);
var w3all_ck_lightbox = (w3all_passed_url.indexOf('getw3all_lightbox') > -1); // maybe it is not more necessary
var w3all_ck_quickmod = (w3all_passed_url.indexOf('quickmod') > -1);
if ( w3all_ck_lightbox == true || w3all_ck_quickmod == true || w3all_onview_topic == false && w3all_onview_attach == false && w3all_onview_post == null ) {
window.scrollTo(0, 200);
}
This change will return a better iframe scroll experience, in any test i've try out.
Now work fine.
Wp template page-forum.php (or whatever you had name it) will result more clean and easy to understand in this way.