Commit 2704d04c by doszhang

dos

parent a0b92dc8
......@@ -119,6 +119,8 @@ $(document).ready(function () {
$('.home-page .btn-rule').on('click', showRule);
//返回首页
$('.rule-page .btn-back').on('click', hideRule);
//滚动条
$('.rule-block').on('scroll', ruleScroll);
......@@ -156,6 +158,16 @@ $(document).ready(function () {
});
});
function ruleScroll() {
//7.9-46.9
let blockHeight = $('.rule-block').height() / fontSize;
let wrapHeight = 155;
let scrollHeight = wrapHeight - blockHeight;
let step = (scrollHeight / 39) * fontSize;
let scrollTop = $('.rule-block').scrollTop();
$('.scroll-bar').css('top', scrollTop * step + 'rem');
}
function hideRule() {
$('.rule-page').hide();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment