在jQuery中创建块过渡的最佳方法是什么?有没有提供这种转换的插件(只提供转换,我不想要有这样的转换的图片库!)?
我正在寻找类似于http://mitya.co.uk/scripts/Blockster-transition-effect-122或http://codecanyon.net/item/jquery-banner-rotator-slideshow/full_screen_preview/109046的对角扩展块转换
第一个链接的问题是,当使用更多的块时,它非常慢。我不明白在第二个链接上是如何创建转换的。
发布于 2012-01-26 11:16:41
如果您将此代码添加到144行上的blockster.js中,则会有更多的块同时淡入淡出。
/* ------------------
| ANIMATION - with all blocks built, set an interval to turn them all on, one by one.
| When all blocks in position, and all have finished anim (if fade rather than simple)
| - kill int
| - shuffle slides so the one our blocks contain parts of is genuinely topmost
| - remove blocks
------------------ */
var simultaneous = 5;
for(var i = 0; i < simultaneous; ++i)
{
addTimer(nextSlide, thiss, i, simultaneous);
}
}
function addTimer(nextSlide, thiss, i, simultaneousBlocks)
{
setTimeout(function()
{
var animInt = setInterval(function()
{
if(thiss.params.holder.children('.block:not(:visible)').length > 0)
{
var blocks = thiss.params.holder.children('.block:not(:visible)');
with($(blocks.get(!thiss.params.random ? 0 : Math.floor(Math.random() * blocks.length)))) thiss.params.animType == 'simple' ? show() : fadeIn(thiss.params.blockAnimSpeed);
}
else if ($('.block:animated').length == 0)
{
clearInterval(animInt);
nextSlide.siblings().hide();
nextSlide.show();
$('.block').remove();
}
}, thiss.params.blockAnimSpeed);
}, (thiss.params.blockAnimSpeed / simultaneousBlocks) * i);
}https://stackoverflow.com/questions/8520960
复制相似问题