Reputation: 10736
I'm working on a custom navigation thumbnail slider for the Nivo Slider Jquery plugin.
I'm trying to hide the Next anchor when the thumbnail slider contains less than or equal to 6 thumbnails.
.nivo-control
is the anchor the thumbnail images are children of, and they are all children of .items
.
I've already tried:
if ($('.items').children('.nivo-control') <= 6) {
$('a.next').css('display', 'none !important');
} else {
// Do something
}
Upvotes: 2
Views: 634
Reputation: 37376
Use
if ($('.items').children('.nivo-control').length <= 6) {
$('a.next').css('display', 'none !important');
} else {
// Do something
}
Upvotes: 6
Reputation:
Try this:
if ($('.items').children('.nivo-control').length <= 6) {
$('a.next').css('display', 'none !important');
} else {
// Do something
}
Upvotes: 5