首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有人帮助我创建一个wordpress进度条和文本或图像显示后,100%?

有人帮助我创建一个wordpress进度条和文本或图像显示后,100%?
EN

Stack Overflow用户
提问于 2022-05-25 14:24:36
回答 1查看 41关注 0票数 0

完成进度栏后,最多可达100%,然后隐藏进度条,然后显示图像、链接或按钮。

请分享你的经验。

EN

回答 1

Stack Overflow用户

发布于 2022-05-28 07:37:19

我做了一些您可以在此链接中看到的例子,我的代码如下:

html代码:

代码语言:javascript
复制
<div class="contet">

<div class="panel panel-default counter-panel card">
    <div class="panel-body text-center card-body" id="__procon">
        <div id="wpdm_lazy_download_" class="progress progress-striped active">
            <div class="progress-bar progress-bar-success progress-bar-striped  progress-bar-animated"
                 role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
                <span class="sr-only">Please Wait...</span>
            </div>
        </div>
    </div>
    <div id="wpdmw8" class="panel-footer card-footer">Please Wait...</div>
</div>

css代码:

代码语言:javascript
复制
.contet {
    max-width: 50%;
    margin: 50px auto;
    display: block;
    text-align: center;
    box-shadow: 0 0 10px #00000017;
    border-radius: 8px;
    padding: 50px;
}

.card {
    position: relative;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: 0.25rem;
}

.counter-panel {
    width: 400px;
    max-width: 90%;
    margin: 10px auto;
}

.counter-panel .panel-body {
    padding: 15px;
}

.counter-panel .progress {
    height: 50px;
    border-radius: 3px;
    margin: 0;
}

.counter-panel .circle {
    font-family: 'Courier Prime', monospace;
    font-size: 40pt;
    color: #000;
    letter-spacing: 1px;
}

.counter-panel .panel-footer {
    font-family: 'Courier Prime', monospace;
    text-align: center;
    letter-spacing: 1px;
}

@-webkit-keyframes progress-bar-stripes {
    from {
        background-position: 1rem 0;
    }
    to {
        background-position: 0 0;
    }
}

@keyframes progress-bar-stripes {
    from {
        background-position: 1rem 0;
    }
    to {
        background-position: 0 0;
    }
}

.progress {
    display: -ms-flexbox;
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.progress-bar {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-pack: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: #4a8eff;
    transition: width 0.6s ease;
}

@media (prefers-reduced-motion: reduce) {
    .progress-bar {
        transition: none;
    }
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    -webkit-animation: progress-bar-stripes 1s linear infinite;
    animation: progress-bar-stripes 1s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .progress-bar-animated {
        -webkit-animation: none;
        animation: none;
    }
}

.btn {

    text-transform: uppercase;
    color: #fff;
    background-color: #4a8eff;
    border-color: #4a8eff;
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: 0.3rem;
    display: block;
}

.card-footer:last-child {
    border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px);
}
.counter-panel .panel-footer {
    font-family: 'Courier Prime', monospace;
    text-align: center;
    letter-spacing: 1px;
}
.panel-footer {
    color: #555555;
}

jQuery代码:

代码语言:javascript
复制
jQuery(function ($) {
    $("#wpdm_lazy_download_ .progress-bar").animate({width: "100%"}, -1000, function () {
        //jQuery.cookie("wpdm_lazy_download_'.$lazy_download_id.'","-1", { expires: 1, path: "/" });
        var d = new Date();
        var n = d.getMilliseconds();

        setTimeout(
            function () {
                $('#wpdmw8').html('Your Download is Ready!');
                $('#__procon').html("<a href='' class='btn btn-primary btn-block btn-lg'>Download</a>");

            }, 1000);


    });
});

让我去检查的地方。

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

https://stackoverflow.com/questions/72379434

复制
相关文章

相似问题

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