大家好!
我们今天要实作的自订滚动卷轴,不仅能自订方向、选择更多样式,甚至支援度比 CSS 更广。
我们进入今天的主题吧!
(function () {
const bar = Felix('body').insert('#scrollbar');
bar.style = 'position: fixed; left: 0; right: 0; bottom: 0; z-index: 999; width: 0; height: 0.5em; background-color: rgb(250, 125, 125);';
window.addEventListener('scroll', function () {
const schedule = window.scrollY / (Felix('html')[0].clientHeight - window.innerHeight);
bar.style.width = schedule * 100 + '%';
});
})();
差不多也到尾声了。
如果对文章有任何疑问,也欢迎在下方提问和建议!
我是 Felix,我们明天再见!
>>: Day28 softirq, tasklet, workqueue
Struct就像是轻量版本的Class~ 但它们间还是有几点差异性~ 我们今天就来看看Struct跟...
D6: for回圈 最基本的for回圈样式是: for (变数初始值; 判断式; 递增式){ 陈述句...
早安呦~ 成旅的老顾客,许多都是退休人士,其中不乏金字塔顶尖的消费族群。依他们的经济能力,是可以选择...
上一篇讲到离职时整理档案的重要,相对的每个人的工作日志或工作排程,也是个人的保命符,一定要写得清楚明...
前言 我们昨天聊到要透过解析 threadPool 档案中的 FinishContinuations...