[英]Anyone help me to create a wordpress progress bar and text or image show after 100%?
完成进度条达到 100% 后,隐藏进度条,然后显示图像或链接或按钮。
请分享您的专业知识。
我做了一些东西你可以在这个链接中看到这个例子我的代码如下:
html代码:
<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代码:
.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代码:
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);
});
});
哪里很难告诉我检查。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.