Reputation: 359
I'm struggling to find an option to select the img of the div.
In my markup I only have this:
<div class="slideshow-container">
<div id="loading" class="loader"></div>
<div id="slideshow" class="slideshow"></div>
</div>
When it is rendered in browser it is like this:
This is the gallery I use: Galleriffic
I want to select the images of the #slideshow
and add class to it. Please help.
UPDATE: In the gallery js file I have found where the image is added, but I cant get it to add a class.
Here's what I'm trying:
Upvotes: 0
Views: 89
Reputation: 3650
I accomplished this by modifying the refresh function of galleriffic:
refresh: function() {
// skip to this line of code:
if (!imageData.image) {
var image = new Image();
// Add this line
image.className = your_class_name_here
Upvotes: 1
Reputation: 14827
Try this:
$("#slideshow").find('.advance-link').children('img').addClass('newClass');
Upvotes: 0
Reputation: 123739
Try this:- You may need to look at the jquery selectors.
$('#slideshow img').addClass('newclass');
If you want to specifically look at the images inside your hyperlink and done want to affect any other images if present in the #slideshow
directly you should use this.:-
$("#slideshow > .advance-link > img").addClass('newClass');
Upvotes: 2