我正在使用 contentSwitcher 开发一个登陆页面,一切正常,但我想知道如何一个接一个地为其内容制作动画,只是为了添加一些花哨的风格。 Test Landing Page
您可能会看到下面有标题、副标题、段落和图像,我如何向这些元素中的每一个添加淡入效果,这些元素彼此间隔几秒?
感谢您的帮助!
最佳答案
您可以使用在动画完成时触发的回调函数
看这里:
示例:
$('#element1').fadeIn('slow', function() {
// this will be called then the first animation is complete
$('#element2').fadeIn('slow', function() {
// this will be called then the second animation is complete
$('#element3').fadeIn('slow', function() {
// this will be called then the third animation is complete
});
});
});
要将动画延迟几秒钟,请使用 .delay()
关于jquery - 切换内容,动画其内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9922173/