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
To change your current page to the href attribute of that element:
document.location.href = $('#page-contact').attr('href');
EDIT now that we have the real question, I think you can do this:
var obj = Shadowbox.setup('#page-contact');
Shadowbox.open(obj);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With