Search code examples
javascriptjqueryhtmlshadowbox

jquery open anchor link from function


Say I have an anchor link like:

<a id="page-contact" rel="shadowbox;width=640;height=400" href="/contact.php">link here</a>

How would I be able to open it from jquery i.e.

jQuery('#page-contact').click();

Obviously that calls the .click event but doesn't do the href if that makes sense.

The object of this is to actually open a lightbox not to change the page like window.location


Solution

  • Beat the geeks again!

    I've done this and it works! :-)

    Shadowbox.open({
            content:    '/content.php',
            type:     'iframe',
            title:      'Tags',
            height:350,
            width:450
        });