Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How can I make embeddable forum 'jump' to top of iframe when link clicked?

conorcanconorcan New
edited June 2011 in Vanilla 2.0 - 2.8
Why? Because otherwise the user can be presented with blank or cut off pages.

The best way to explain this is by example.

If you look at the list of discussions on fiverfriday.com, you'll see that it is an embedded forum. Now, if you click on a link near the bottom of that list you'll apparently get a white page.

Clicking on a link within the iframe of an embeddable page should take you to the top of that iframe so that this situation doesn't happen.
Tagged:

Best Answer

  • ToddTodd Vanilla Staff
    Answer ✓
    Hmm. It does look like you are using embed vanilla, but perhaps some other script on you page is interfering.

    One thing you can try is giving an element just above the forum an id and then adding the following javascript:
    parent.location.hash.replace('#header');

Answers

  • I'm on a lead:

    Add this to the default.master.tpl file in the views folder:

    onload="self.scrollTo(0,0)"

    It doesn't work, but

    onload="parent.scrollTo(0,0)"

    works on scrolling THE WHOLE page back to the top (which is not what I want).
  • ToddTodd Vanilla Staff
    Can I ask you why you didn't use embed vanilla? It looks like you just put the forum in an iframe.
  • ToddTodd Vanilla Staff
    Answer ✓
    Hmm. It does look like you are using embed vanilla, but perhaps some other script on you page is interfering.

    One thing you can try is giving an element just above the forum an id and then adding the following javascript:
    parent.location.hash.replace('#header');
  • Thanks Todd, in the end I decided to use the non-embeddable version.
Sign In or Register to comment.