I have a slideshow with a few images.
There is a NEXT-Link (id: #next) to slide through.
I want to change the CSS-color of the NEXT-link,
as soon as it arrives at last image.
I have something like that now:
if($('img.next()').is(":last-child")){$('#next').css('color:#666');}
else{$('#next').css('color:#111');}
What’s wrong with that?
Your
.css()syntax is a little off. If you are setting only one CSS property value pair, as you are in the code above, the.css()method takes two parameters.If you need to add more than one property value pair to an element with
.css()it accepts a single object as a parameter.You can read more about it in the jQuery docs.
For your specific case, the code should look more like this:
Hope that helps!