Using jquery: Jquery lightbox doesnt work with AdGallery on newest questions tagged jquery – Stack Overflow
Im using AdGallery for creating an image gallery (following this plugin : http://coffeescripter.com/2009/07/ad-gallery-a-jquery-gallery-plugin/).
And Jquery lightbox : http://leandrovieira.com/projects/jquery/lightbox/
Now I want this, when user click on the large image, a lightbox appears. So I modified some lines of code in jquery.ad-gallery.js:
from
if(image.link) {
var link = $('<a rel="lightbox" href="'+ image.link +'" target="_blank"></a>');
link.append(img);
img_container.append(link);
} else {
img_container.append(img);
}
to
if(image.link) {
var link = $('<a rel="lightbox" href="'+ image.link +'" target="_blank"></a>');
link.append(img);
img_container.append(link);
} else {
var link = $('<a href="'+ image.image +'" rel="lightbox" class="lightbox"></a>');
link.append(img);
img_container.append(link);
}
But when I click on the large image, nothing happened.
I did have these code in my html:
$(function() {
$('#gallery a').lightBox();
});
What was I missing here?
See Answers
source: http://stackoverflow.com/questions/8486309/jquery-lightbox-doesnt-work-with-adgallery
Using jquery: using-jquery
Recent Comments