wolfestone
Feb 25th 2009, 1:59 pm
I'm using Jquery lightbox, and from the documentation, some ways to call it are below.
I have several lightboxes on one page, but they're not related so I don't want it to group the images. I've achieved what I want to do by inserting multiple scripts at the top of the page, all looking for a different "rel=" parameter.
But, I know there's got to be a cleaner way to do it.
Any suggestions?
<script type="text/javascript">
$(function() {
// Use this example, or...
$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
// This, or...
$('#gallery a').lightBox(); // Select all links in object with gallery ID
// This, or...
$('a.lightbox').lightBox(); // Select all links with lightbox class
// This, or...
$('a').lightBox(); // Select all links in the page
// ... The possibility are many. Use your creative or choose one in the examples above
});
</script>
I have several lightboxes on one page, but they're not related so I don't want it to group the images. I've achieved what I want to do by inserting multiple scripts at the top of the page, all looking for a different "rel=" parameter.
But, I know there's got to be a cleaner way to do it.
Any suggestions?
<script type="text/javascript">
$(function() {
// Use this example, or...
$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
// This, or...
$('#gallery a').lightBox(); // Select all links in object with gallery ID
// This, or...
$('a.lightbox').lightBox(); // Select all links with lightbox class
// This, or...
$('a').lightBox(); // Select all links in the page
// ... The possibility are many. Use your creative or choose one in the examples above
});
</script>