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 JS

Discussion in 'XenForo Development Discussions' started by Dasfaust, May 22, 2012.

  1. Dasfaust

    Dasfaust Member

    How would one go about triggering an overlay with Javascript? I could only find one post on this subject, and this is what I've got so far:
    var $trigger = window.onload;
    var $templateHtml = "test";
    XenForo.createOverlay($trigger, $templateHtml).load();
    But I'm getting this error:
    Uncaught TypeError: Cannot call method 'refresh' of null xenforo.js:191
        c.extend.activate xenforo.js:191
        jQuery.fn.extend.xfActivate xenforo.js:177
        c.extend.createOverlay xenforo.js:199
        (anonymous function)
    Am I going about this right?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page