且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Fancybox2在下一个/上一个图库图像过渡期间略微透明

更新时间:2023-10-31 23:12:52

好吧,我终于弄清楚了,所以我把它放在这里,以防其他人想知道.您只需要在fancybox .js文件的以下部分中将不透明度从0.1更改为1.0:

Well I finally figured it out, so I'll just put this here in case anyone else was wondering. You just need to change the opacity from 0.1 to 1.0 in the following section of the fancybox .js file:

changeOut: function () {
        var previous  = F.previous,
            effect    = previous.prevEffect,
            endPos    = { opacity : 1.0 },
            ...

这样,当旧图像开始淡出时,下一个图像库图像将已经可见.显然,这仅应用于具有淡入淡出"过渡的相同大小的图像,因此应将更改更改为.js文件的副本,以便可以在需要时加载.

This way the next gallery image will be already visible when the old one starts to fade out. And obviously this should only be used for images of the same size with the "fade" transition, so the change should be made into a copy of the .js file so it can be loaded when needed.

同样,"changeIn"函数的"startPos.opacity"可以从0.1更改为0.0,以使过渡开始更加平稳.

edit: Also the "startPos.opacity" of the "changeIn" function can be changed from 0.1 to 0.0 to make the transition start even more smoothly.