如何实现幻灯片过渡效果? [英] how to implement slideshow transition effects?

查看:214
本文介绍了如何实现幻灯片过渡效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为在幻灯片放映的过渡效果中,仅可以使用淡入和淡出两种动画方法,其他方法必须由css实现,对吗?如果不是,请举个例子,如果可以,请指导我我该如何实施其中一些,或者以前有人做过?

I think in transition effects in slideshows,just two animation methods of fade in and fade out are ready to use,others have to be implemented by css,am I right?if not,please give examples,if yes,guide me how can I implement some of them,or have anyone done it before?

推荐答案

fadeIn()fadeOut()是最易于使用的,但它们只是jquery动画功能的快捷方式.与所有其他动画(包括自定义动画)一样,它们使用css,您不必直接处理它.

The fadeIn() and fadeOut() are the easiest to use but they are just shortcuts to jquery's animate function. These use css, just like all the other animations including custom one's, you just don't have to deal with it directly.

在jQuery中,您可以使用动画功能转换具有数值(高度,宽度,顶部,左侧等)的任何CSS值.对于更复杂的内置方法,您可以尝试

In jQuery you can use the animation function to transition any css value that has a numeric value (height,width,top,left,etc.) For more complex built-in methods you can try the jQuery UI library.

一个例子:

$('#myDiv').animate({height:30,width:300,top:400,left:300});

有关详细信息,请参见 jQuery动画文档.

See the jQuery animate documentation for more details.

我还构建了自己的您可以找到的jQuery滑块这里.进入源代码可能会给您更多信息,因为它会大量处理动画的位置和大小.

I have also built my own jQuery slider which you can find here. Going into the source code may give you more information as it deals heavily with animating the position and size of images.

希望这会有所帮助.

这篇关于如何实现幻灯片过渡效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆