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

Create/Open Overlay via JavaScript

Discussion in 'XenForo Development Discussions' started by LiquidPro, Feb 8, 2012.

  1. LiquidPro

    LiquidPro Active Member

    Does anyone know if there is a way to create an overlay and show it via javascript? I am working on some functionality that when I drag and drop something, I want it to pop up an overlay. This is the same overlay as if you added the class OverlayTrigger to a link.

    Here is my temporary work around, but this is awful.

    In my template...
    <a href="linktodisplay" class="OverlayTrigger" id="newInstance" style="display: none;"></a>
    In my javascript...
    The fudging that went into that makes me want to puke...
  2. Fuhrmann

    Fuhrmann Well-Known Member

    You can use this:

    XenForo.createOverlay($trigger, $templateHtml).load();
    Just change the $trigger and the $templateHtml.
  3. LiquidPro

    LiquidPro Active Member

    Just a little hitch in that... you have to give it the HTML to display. I still want the AJAX functionality.

Share This Page