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

Trigger an overlay via javascript

Discussion in 'XenForo Development Discussions' started by Jake B., Jan 8, 2015.

  1. Jake B.

    Jake B. Well-Known Member

    I'm needing to trigger an overlay using javascript. Currently I have a button doing this using
    <a href="{xen:link link}" class="OverlayTrigger">
    However, I also need to be able to open it on a specific keypress, but am unable to find a usable function to open the overlay by passing the URL to it.

    Perhaps @Mike could be of assistance, since I assume this was written by you.


  2. Chris D

    Chris D XenForo Developer Staff Member

    This isn't totally right and will need some improvements but at a basic level:

    So if you can get a JS event to trigger that, that's the cheaty, hacky way.

    For something more robust, look at what triggers the Create Album overlay to load on the Media Add form in the Gallery.
    Jake B. likes this.
  3. Jake B.

    Jake B. Well-Known Member

    That worked, thanks!

Share This Page