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
有基本的了解,所以有人能指导我,如果这个posiblepre按钮
将默认显示无
,而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();
});