2

我正在为 Nivo Slider Jquery 插件开发自定义导航缩略图滑块。

当缩略图滑块包含少于或等于 6 个缩略图时,我试图隐藏下一个锚点。

.nivo-control是缩略图图像是其子级的锚点,它们都是.items.

我已经尝试过:

        if  ($('.items').children('.nivo-control') <= 6) {
            $('a.next').css('display', 'none !important');
        } else {
            // Do something
        }
4

2 回答 2

6

采用

    if  ($('.items').children('.nivo-control').length <= 6) {
        $('a.next').css('display', 'none !important');
    } else {
        // Do something
    }
于 2011-09-30T15:36:08.887 回答
5

试试这个:

   if  ($('.items').children('.nivo-control').length <= 6) {
        $('a.next').css('display', 'none !important');
    } else {
        // Do something
    }
于 2011-09-30T15:36:16.843 回答