博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
鼠标滚动改变导航栏进度
阅读量:7070 次
发布时间:2019-06-28

本文共 1265 字,大约阅读时间需要 4 分钟。

  hot3.png

滚动事件

function scrollBar() {    if (document.body.clientWidth > 860) {        $(window).scroll(function () {            var s = $(window).scrollTop();            var a = $(document).height();            var b = $(window).height();            var result = parseInt(s / (a - b) * 100);            $("#bar").css("width", result + "%");            if (false) {                if (result >= 0 && result <= 19)                    $("#bar").css("background", "#cccccc");                if (result >= 20 && result <= 39)                    $("#bar").css("background", "#50bcb6");                if (result >= 40 && result <= 59)                    $("#bar").css("background", "#85c440");                if (result >= 60 && result <= 79)                    $("#bar").css("background", "#f2b63c");                if (result >= 80 && result <= 99)                    $("#bar").css("background", "#FF0000");                if (result == 100)                    $("#bar").css("background", "#5aaadb");            } else {                $("#bar").css("background", "orange");            }            $(".toc-container").css("height", $(".site-content").outerHeight());            $(".skin-menu").removeClass('show');        });    }}

 

转载于:https://my.oschina.net/lemos/blog/3057158

你可能感兴趣的文章
java.lang.VerifyError: Inconsistent stackmap frames at branch target
查看>>
sqlite 判断表中是否包含 某个字段
查看>>
freemarker序列的拆分
查看>>
angularjs基本执行流程
查看>>
线段树 + 区间更新: HDU 4893 Wow! Such Sequence!
查看>>
再探vim经常使用命令
查看>>
[BZOJ 1066][SCOI2007]蜥蜴
查看>>
platform_device与platform_driver
查看>>
sql中update,alter,modify,delete,drop的区别和使用(整理)(转)
查看>>
Enabling Active Directory Authentication for VMWare Server running on Linux《转载》
查看>>
MySql性能优化相关
查看>>
Android学习笔记——Intents 和 Intent Filters(二)
查看>>
收藏的Android很好用的组件或者框架。
查看>>
SQL Server 数据库文件 4 点注意
查看>>
赛马题(转)
查看>>
网页的背景图片代码
查看>>
SURF算法与源码分析、下
查看>>
高速排序算法
查看>>
数学图形之伞形
查看>>
vs2008打包公布程序
查看>>