Create/Open Overlay via JavaScript

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...
Code:
<a href="linktodisplay" class="OverlayTrigger" id="newInstance" style="display: none;"></a>

In my javascript...
Code:
$('#newInstance').click();

The fudging that went into that makes me want to puke...
 
You can use this:

Code:
XenForo.createOverlay($trigger, $templateHtml).load();

Just change the $trigger and the $templateHtml.
 
Just a little hitch in that... you have to give it the HTML to display. I still want the AJAX functionality.
 
Top Bottom