Topic: load page at top

hey all, big_smile

we have got a php forum 1.1.5. the mainpage of the forum is quite big, cause we have a lot of sections. but the pages do not load from the top. when you click on a section you should link to the top of that page... cause you still have to scroll up, it seems the page does not load... so when you click on a section thats low in the main page, the next page opens at the same hight, instead of directing to the top of that sectrion.

i hope you understand me and know how to fix this?

thx a lot
dark

Re: load page at top

The reason that happens is because you have your forums in an iframe. I can't think of a way of solving it. Perhaps adding a JavaScript bit in the template would do it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: load page at top

thx for your reply rickard big_smile
so the i-frame makes that happen?? sad

did you have a specific javascript in mind? and furthermore in which file should I add the javascript?

Re: load page at top

possibly just add <body onload="window.scrollTo(0,1)"> to the template.tpl file.

Indocron
$theQuestion = (2*b) || !(2*b);

Re: load page at top

thx for you reply Gary! big_smile
but i do not have (or see) the template.tpl file.
i do see a directory named template with three files in there: main.tpl, maintenance.tpl and redirect.tpl. i looked to see where to place it but iam confused lol
any idea where to place it and in which file?
iam srry for my incompetece roll

Re: load page at top

He's talking about main.tpl. However, I doubt it will work. PunBB occationally adds it's own onload attribute to the body tag.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: load page at top

hmmm ok thx again
it's a pity then.... i suppose we should lose the iframe to make it better.... sometimes i have the idea the page does not load, but you only have to scroll up.. well anyways thx for your replies big_smile

Re: load page at top

You could try adding the following somewhere in your main.tpl (e.g. after the body tag):

<script type="text/javascript">window.scrollTo(0,1)</script>
"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: load page at top

after some thought...

this would work (maybe) if the iframe is in the main.tpl file. after looking at it, it looks lke the site is built, and then is including the forum in an iframe.

my suggestion, take the code before the iframe and add it into the beginning of main.tpl. take the end and add it to the end.. this way there wont be an iframe, and should solve your problem.

BTW, do this on another part of the site, as i can see your forum is big, and i dont want to cause problems for your members

Indocron
$theQuestion = (2*b) || !(2*b);

Re: load page at top

we'll be testing this soon.. i''l be back to let you know....
many thx for your thoughts and replies big_smile