首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HTML用Javascript更改数据,并增加问题更改的持续时间?

HTML用Javascript更改数据,并增加问题更改的持续时间?
EN

Stack Overflow用户
提问于 2022-01-11 14:04:57
回答 1查看 22关注 0票数 -1

HTML用jquery更改数据,并增加问题更改的持续时间?我试图用jquery更改具有一定时间期限的HTML文本。

EN

回答 1

Stack Overflow用户

发布于 2022-01-11 14:06:17

代码语言:javascript
复制
var sets = $(".set")
var set = sets[0], quote = 0;

sets.hide();

$(sets[0]).fadeIn(1500);

function showQuote() {
    if($(set).children().eq(quote).is(':last-child')) {
        if($(set).hasClass("last")) {
            set = $(".set").first();
        } else {
            set = $(set).next();
        }
        sets.hide();
        $(set).fadeIn(1500);
        quote = 1;
    } else {
        ++quote
    }

    $(set).children().eq(quote)
        .fadeIn(1500)
        .delay(1000)
        .fadeOut(1000, showQuote);
}

showQuote();
代码语言:javascript
复制
<div class="row">
            <div class="col-md-12 col-md-how" style="">
                <div class="col-xl-12 bg-banner-text text-center" style="padding-top:3%;">
                    <h1 style="font-size:36pxx !important;" class="sec1-head set">How do we do it?<br/>
                        <span style="" class="quotes sec1-head-quotes">Ethical and Humanizing AI</span>
                        <span style="display: none;"  class="quotes sec1-head-quotes">Redefine professional and academic achievement</span>
                        <span style="display: none;"  class="quotes sec1-head-quotes">Create a data driven Soft-Skills resume</span>
                    </h1>
                    <h1 style="font-size:36pxx !important;" class="sec1-head set last">Curating Experiences for Credentials<br/>
                        <span style="" class="quotes sec1-head-quotes">School</span>
                        <span style="display: none;"  class="quotes sec1-head-quotes">Work</span>
                        <span style="display: none;"  class="quotes sec1-head-quotes">Internships</span>
                        <span style="display: none;"  class="quotes sec1-head-quotes">Apprenticeship</span>
                        <span style="display: none;"  class="quotes sec1-head-quotes">Workshops</span>
                        <span style="display: none;"  class="quotes sec1-head-quotes">Co-Curricular Activities</span>
                    </h1>
                </div>
            </div>
            </div>
        </div>
        <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70668146

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档