顶部增补彩色进度条

美化教程

CSS代码 :

javascript代码 :

//进度条加载显示
$(<a target="_blank" href="https://www.kaiyuanyuanma.com/tag/701.html" title="View all posts in window">window</a>).scroll(function(){
var a = $(window).scrollTop(),增补
c = $(document).height(),
b = $(window).height();
scrollPercent = a / (c - b)*100;
scrollPercent = scrollPercent.toFixed(1);
$("#percentageCounter").css({
width: scrollPercent + "%"
});
}).trigger("scroll");
//进度条加载显示$(window).scroll(function() {    var a = $(window).scrollTop(),    c = $(document).height(),    b = $(window).height();    scrollPercent = a / (c - b) * 100;    scrollPercent = scrollPercent.toFixed(1);    $("#percentageCounter").css({        width: scrollPercent + "%"    });}).trigger("scroll");
//进度条加载显示$(window).scroll(function() { var a = $(window).scrollTop(), c = $(document).height(), b = $(window).height(); scrollPercent = a / (c - b) * 100; scrollPercent = scrollPercent.toFixed(1); $("#percentageCounter").css({ width: scrollPercent + "%" });}).trigger("scroll");

在主题目录header.php中,增补以下代码,彩色放在body标签下(最后一行)

进度
<div id="percentageCounter"></div>

 

进度
内容校验完了
渝ICP备2025076537号-22