nivo-lightbox 插件 slideIn images onclick of next or previous
nivo-lightbox plugin slideIn images onclick of next or previous
我不知道有多少人使用过这个 plugin, demo 但我想要的是将插件的默认行为更改为类似 animated
.目前,当您单击 next
或 previous
按钮时,将仅附加图像而没有任何视觉动画。我只想在附加时为图像设置动画!任何人都可以提出任何好的解决方案!下面是在图像上进行附加的代码:
if (href.match(/\.(jpeg|jpg|gif|png)$/i) !== null) {
var img = $('<img>', { src: href });
img.one('load', function () {
var wrap = $('<div class="nivo-lightbox-image" />');
wrap.append(img); //gets appended here
content.html(wrap).removeClass('nivo-lightbox-loading');
// Vertically center images
wrap.css({
'line-height': $('.nivo-lightbox-content').height() + 'px',
'height': $('.nivo-lightbox-content').height() + 'px' // For Firefox
});
}).each(function () {
if (this.complete) $(this).load();
});
}
任何类型的动画都可以
好吧,我只是在附加后添加了一个 fadeIn
,它似乎可以执行某种动画,尽管这是我接受的。这是我所做的:
wrap.append(img).fadeIn('4000');
我不知道有多少人使用过这个 plugin, demo 但我想要的是将插件的默认行为更改为类似 animated
.目前,当您单击 next
或 previous
按钮时,将仅附加图像而没有任何视觉动画。我只想在附加时为图像设置动画!任何人都可以提出任何好的解决方案!下面是在图像上进行附加的代码:
if (href.match(/\.(jpeg|jpg|gif|png)$/i) !== null) {
var img = $('<img>', { src: href });
img.one('load', function () {
var wrap = $('<div class="nivo-lightbox-image" />');
wrap.append(img); //gets appended here
content.html(wrap).removeClass('nivo-lightbox-loading');
// Vertically center images
wrap.css({
'line-height': $('.nivo-lightbox-content').height() + 'px',
'height': $('.nivo-lightbox-content').height() + 'px' // For Firefox
});
}).each(function () {
if (this.complete) $(this).load();
});
}
任何类型的动画都可以
好吧,我只是在附加后添加了一个 fadeIn
,它似乎可以执行某种动画,尽管这是我接受的。这是我所做的:
wrap.append(img).fadeIn('4000');