Just another way to scroll the iframe - preparing v4 - advanced questions and solutions hints
Posted: Sun Mar 17, 2019 10:10 am
Preparing v4 code ...
Really SO Hard to explain the concept for me, but i will try, also searching for hints by cool guys.
This is another solution about how to workaround to the phpBB scroll, that should be correctly presented after the onlick action into any iframe link.
The phpBB smooth scroll solution works fine. But it scroll BEFORE the page load.
How to scroll, AFTER iframe loads?
The solution is simple for all events, except one that i've test:
when the link contain #anchor that make phpBB scroll down to the last post on topic (if order is descendant x example), then what i have not find the way to resolve easily, is that this event, make scroll to top the page anyway to top.
But the post on bottom should be presented instead.
I really have try out any possibility in mind to resolve with smooth scroll and get the right result, but i've fail until now.
So, the problem was (and still remain as it's origin) this:
how to scroll AFTER iframe loaded, to correct position?
At moment on this online example, the solution applied to the v3 iframe code and to get the AFTER re-position is this:
on overall_footer.html code:
where:
change into:
now into your WP template page-forum(orWhateverYouNamedIt).php
immediately after this line:
ADD this code:
NOTE that .site-content need to match the assigned class of the element that wrap the main WP page content.
That is. The page reposition AFTER iframe loads to correct position, the unique time that it isn't in this way as i experience at time of this post, is when you go to (for example) execute a sticky action (the popup display on top).
I will check how to work around this.
Note that here, is not possible for what i tested out, to smooth scroll:
will not work. The page when on #anchor links will scroll to top by the way.
Any solution?
Really SO Hard to explain the concept for me, but i will try, also searching for hints by cool guys.
This is another solution about how to workaround to the phpBB scroll, that should be correctly presented after the onlick action into any iframe link.
The phpBB smooth scroll solution works fine. But it scroll BEFORE the page load.
How to scroll, AFTER iframe loads?
The solution is simple for all events, except one that i've test:
when the link contain #anchor that make phpBB scroll down to the last post on topic (if order is descendant x example), then what i have not find the way to resolve easily, is that this event, make scroll to top the page anyway to top.
But the post on bottom should be presented instead.
I really have try out any possibility in mind to resolve with smooth scroll and get the right result, but i've fail until now.
So, the problem was (and still remain as it's origin) this:
how to scroll AFTER iframe loaded, to correct position?
At moment on this online example, the solution applied to the v3 iframe code and to get the AFTER re-position is this:
on overall_footer.html code:
where:
Code: Select all
if( /posting\.php\?mode=[reply|post|bump]/ig.exec(href) !== null || /mcp\.php\?/ig.exec(href) !== null ){
var w3allNOappend = true;
}
Code: Select all
if( /posting\.php\?mode=[reply|post|bump]/ig.exec(href) !== null || /mcp\.php\?/ig.exec(href) !== null ){
w3allappend = boardU;
}
immediately after this line:
Code: Select all
history.pushState({w3all_passed_url: w3all_passed_url}, \"Forum\", w3all_passed_url_push);
Code: Select all
jQuery( '#w3all_phpbb_iframe' ).on( \"load\", function() {
jQuery('html, body').animate({
scrollTop: jQuery('.site-content').offset().top
}, 0);
});
That is. The page reposition AFTER iframe loads to correct position, the unique time that it isn't in this way as i experience at time of this post, is when you go to (for example) execute a sticky action (the popup display on top).
I will check how to work around this.
Note that here, is not possible for what i tested out, to smooth scroll:
Code: Select all
jQuery('html, body').animate({
scrollTop: jQuery('.site-content').offset().top
}, 300);
Any solution?