• 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


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...


Well-known member
You can use this:

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