jquery - 切换内容,动画其内容

标签 jquery html css

我正在使用 contentSwitcher 开发一个登陆页面,一切正常,但我想知道如何一个接一个地为其内容制作动画,只是为了添加一些花哨的风格。 Test Landing Page

您可能会看到下面有标题、副标题、段落和图像,我如何向这些元素中的每一个添加淡入效果,这些元素彼此间隔几秒?

感谢您的帮助!

最佳答案

您可以使用在动画完成时触发的回调函数

看这里:

http://api.jquery.com/fadeIn/

示例:

$('#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()

http://api.jquery.com/delay/

关于jquery - 切换内容,动画其内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9922173/

相关文章:

php - 将 JS 链接到 wordpress

javascript - 在不插入多余标签的情况下关闭 contenteditable 中的 <ul/> 标签

javascript - Parsly javascript 表单验证器

javascript - jquery延迟将类添加到多个元素

jquery - 展开/折叠在Chrome中不起作用,在Firefox中不起作用

javascript - 搜索设计概念的名称

javascript - 如何使用js从输入元素发送图像?

html - 如何强制 Visual Studio 2010 刷新其错误列表窗口?

jquery - 如何在HTML5音频播放器的播放列表中获取每首歌曲的持续时间?

css - 是否可以通过修改名称(斜体,字体粗细)在 css 文件中使用谷歌网络字体?