.trigger("click") not firing I'm trying to automatically launch a dialog box containing an iframe if the user's cursor gets within 25 pixels of the top of the browser window.

In the code, a simulated click of a hidden button should open a dialog box which then loads an iframe containing information inside of a hidden div. However, the code doesn't seem to be executing. What am I doing wrong?

I'm working with Drupal 7. I'm sure there's a far more elegant way of accomplishing my goal, but bear with me right now.

&lt;?php
drupal_add_js('https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js','external');
drupal_add_js('https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js','external');
drupal_add_js('jQuery(document).ready(function() {
    jQuery(document).mousemove(function(e) {
      if (e.pageY&lt;=25) {
     jQuery("dialog_trigger").trigger("click");
        jQuery("#dialog_trigger").click(function() 
        {

        jQuery("#dialog").dialog("open");
      });
    } 
    });
});
    jQuery("#dialog").dialog({
        autoOpen: true,
        position: "center",
        title: "         ",
        draggable: true,
        width: 800,
        height: 700,
        resizable: false,
        modal: true,
    });', 'inline');
?&gt;


&lt;div id="dialog" style="display:none;" title="Dialog Title"&gt;
    &lt;iframe frameborder="0" scrolling="yes" width="700" height="650" src="http://google.about.com/b/2013/04/01/google-nose.htm" style="padding-left:50px;&gt; &lt;/iframe&gt;
&lt;/div&gt;
Never mind. I figured it out:

&lt;?php
drupal_add_js('http://code.jquery.com/jquery-1.9.1.js','external');
drupal_add_js('http://code.jquery.com/ui/1.10.1/jquery-ui.js','external');
drupal_add_js('jQuery(document).ready(function() {

jQuery(document).mousemove(function(e) {

if (e.pageY&lt;=5) {
        jQuery("#dialog").dialog("open");
}
});

    jQuery("#dialog").dialog({
        autoOpen: false,
        position: "center",
        title: "         ",
        draggable: true,
        width: 850,
        height: 700,
        resizable: false,
        modal: true,
    });

});', 'inline');
?&gt;

&lt;button id="dialog_trigger" style="display:none;"&gt;Open The Dialog&lt;/button&gt;
&lt;div id="dialog" style="display:none;" title="Dialog Title"&gt;
    &lt;iframe frameborder="0" scrolling="yes" width="800" height="650" src="http://www.google.com" style="padding-left:25px;"&gt; &lt;/iframe&gt;
&lt;/div&gt;