Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery-prev按钮{display:none}默认值,next按钮将{display:none}默认值_Jquery - Fatal编程技术网

jquery-prev按钮{display:none}默认值,next按钮将{display:none}默认值

jquery-prev按钮{display:none}默认值,next按钮将{display:none}默认值,jquery,Jquery,我对jquery有基本的了解,所以有人能指导我,如果这个posiblepre按钮将默认显示无,而next按钮也将默认显示无 js: 这是应该为你做的。让我知道结果如何 function hideShowLinks() { $('.section').each(function (k, v) { var self = $(this); if (self.hasClass('current')) { if (k == 0) {

我对
jquery
有基本的了解,所以有人能指导我,如果这个posible
pre按钮
将默认显示
,而
next按钮也将默认显示

js:


这是应该为你做的。让我知道结果如何

function hideShowLinks() {
    $('.section').each(function (k, v) {
        var self = $(this);
        if (self.hasClass('current')) {
            if (k == 0) {
                $('#display1').hide();
                $('#display').show();
            } else if (k == ($('.section').length - 1)) {
                $('#display').hide();
                $('#display1').show();
            } else {
                $('#display, #display1').show();
            }
        }
    });
}

hideShowLinks();

$(window).scroll(function () {
    hideShowLinks();
});

是的,您可以使用
.fadeOut('slow')
.fadeIn('slow')
代替
.hide()
.show()
function hideShowLinks() {
    $('.section').each(function (k, v) {
        var self = $(this);
        if (self.hasClass('current')) {
            if (k == 0) {
                $('#display1').hide();
                $('#display').show();
            } else if (k == ($('.section').length - 1)) {
                $('#display').hide();
                $('#display1').show();
            } else {
                $('#display, #display1').show();
            }
        }
    });
}

hideShowLinks();

$(window).scroll(function () {
    hideShowLinks();
});