我的 JQUERY 代码有问题。这是代码:
$maxcounter = $( '.testimonio-popup[id^="popup-"]' ).length;
var i = 0;
while (i < $maxcounter) {
$('#open-'+i).on('click', function() {
$('#popup-'+i).fadeIn('slow');
$('.testimonio-overlay').fadeIn('slow');
$('.testimonio-overlay').height($(window).height());
return false;
});
$('#close-'+i).on('click', function(){
$('#popup-'+i).fadeOut('slow');
$('.testimonio-overlay').fadeOut('slow');
return false;
});
i++;
}
它正确计算了 .testimonio-popup div 在站点中出现的总次数,并且 .testimoniooverlay 类的 fadeIn 操作有效。
但 #popup-[number] 的 fadeIn 操作不起作用。任何帮助为什么?
HUX布斯