opening shadowbox with javascript (start when esc key is pressed)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

opening shadowbox with javascript (start when esc key is pressed)

kdjernigan
    $(window).keyup(function(e) {
   
        if (e.which == 27) {
                 
                    Shadowbox.open({
                    type:       'iframe',
           player:       'iframe',
                    content:    '<?php echo http() . $websiteurl .'/login'; ?>',
                    height:     500,
                    width:      700   })
         
        //window.location.href = '/login'; return false;
         }
    });

I was able to get the page to change when the key was pressed, so I know that works.  What I am trying to do now is get a shadowbox to open when the key is pressed.  I am sure there is something I am missing here that is extremely simple, but I am overlooking something.  I've never done this before, so have no clue how to actually accomplish it.  I've looked around on Stack Overflow and google and can't really find a solid answer to how to do this.

 The code is loaded at the end of the page, so I know the `<?php echo http() . $websiteurl .'/login'; ?>` works because it works with another keypress.  Just wanted to clarify this to clear up any confusion.  The shadowbox isn't even trying to open at all.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: opening shadowbox with javascript (start when esc key is pressed)

kdjernigan
Error in javascript:

Uncaught TypeError: Cannot read property 'style' of undefined shadowbox.js:34
K.onOpen shadowbox.js:34
S.open shadowbox.js:8
(anonymous function) (index):77
b.event.dispatch jquery.js:3
v.handle jquery.js:3


What does this mean?
Loading...