Iframe-resizer: Iframe repositioning on phpBB viewtopic

Created on 14 Sep 2018  路  2Comments  路  Source: davidjbradshaw/iframe-resizer

Hi all, sorry for but i've search around to fix this issue and starting to do some strange js things to fix it but without success until now, so i will follow with some CSS "experiment" to check another way. I know it's complex to understand how all the joke here work, but i hope somebody could help.

The scenario is a phpBB forum iframed into a WordPress page.
The issue, that i can't well explain with my bad Eng, is better explained with the direct link to an example:
https://www.axew3.com/w3/forum/
you can see that phpBB body iframe is well vertical centered in this case with correct gap between the forum wrapper and the wordpress div element that contain it:
image
while if the passed real phpBB link contain the anchor that scroll the phpBB viewtopic.php positioning it to view the last inserted post on topic,
https://www.axew3.com/w3/forum/?forum_id=2&topic_id=857&post_id=3183#p3183
the result is this
image
the iframe is forced to top and the iframe isn't correctly vertically centered.
I know it's maybe also off topic here a question like this? Do not know, i try also this. Thank anybody can take a fast look giving a possible solution, i will follow also with any update (if this will be not removed!) cheers!

Most helpful comment

the complete correct code added into overall_footer.html is this:

// fix vertical align on viewtopic.php or preview, where # anchor etc
$(window).load(function() {
var bd = document.getElementsByTagName("body");
for (var i = 0; i < bd.length; i++) { 
    var bdID = bd[i].getAttribute("id"); 
}
var elt = document.getElementById(bdID);    
elt.setAttribute("style", "position:fixed;top:0%;left:0%;width:100%;");
});

It's valid for any phpBB theme. If no any hint on how to resolve this issue via resizer js code, this question can be considered as resolved in this way? Regards

All 2 comments

it seem resolved via CSS by adding this code into the _body_ selector of the file common.css (phpBB CSS default prosilver theme in this case):

position: fixed;
  top: 0%;
  left: 0%;
  width:100%;

can't believe that this solution have come out finally

the complete correct code added into overall_footer.html is this:

// fix vertical align on viewtopic.php or preview, where # anchor etc
$(window).load(function() {
var bd = document.getElementsByTagName("body");
for (var i = 0; i < bd.length; i++) { 
    var bdID = bd[i].getAttribute("id"); 
}
var elt = document.getElementById(bdID);    
elt.setAttribute("style", "position:fixed;top:0%;left:0%;width:100%;");
});

It's valid for any phpBB theme. If no any hint on how to resolve this issue via resizer js code, this question can be considered as resolved in this way? Regards

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TarsisDragomir picture TarsisDragomir  路  5Comments

speedpacer picture speedpacer  路  6Comments

snarfed picture snarfed  路  5Comments

sebaplaza picture sebaplaza  路  5Comments

thomasbilk picture thomasbilk  路  4Comments