1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Overlay onClose

Discussion in 'XenForo Development Discussions' started by Valhalla, Apr 3, 2014.

  1. Valhalla

    Valhalla Well-Known Member

    How could I reload the page upon closing an overlay?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    A very cheap way of doing it...

    Add this to the overlay template:
    HTML:
    <a href="{xen:link 'link/to/page'}" class="button OverlayCloser">{xen:phrase close}</a>
     
    Brogan likes this.
  3. Valhalla

    Valhalla Well-Known Member

    Thanks. I'd considered that, but I didn't think (?) it would work if I close the overlay if I simply 'escaped' out.
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Yes, that is the gotcha, I think.

    A more advanced way is doing it is with Javascript. There is an event triggered called onBeforeClose. Bind a function to that event and that should cover all eventualities.
     
    Valhalla likes this.

Share This Page