Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
rich-scroll-bar
Advanced tools
Readme
一个兼容到ie8的的滚动条
给任意元素加上scroll属性即可实现滚动,scroll属性中可以写css样式,可以使用scroll-speed属性来改变滚动速度,大致如下:
<!-- 定义一个宽度为8,颜色为红色的滚动条,以标准速度的2倍进行滚动 -->
<div scroll="width:8px; background:#f00" scroll-speed="2">...</div>
<!-- 定义一个默认样式的滚动条,以标准速度滚动 -->
<div scroll>...</div>
考虑到这个问题,在1.0.4版本中添加了动态添加滚动条的相关操作,我给window添加了一个函数richScroll,调用此函数即可,typescript定义如下:
function richScroll ( JQuery | HTMLElement ) : {
clear:()=>any,
reload:()=>any
}
下面是一个使用的例子:
function test(){
$(document.body).append($('<div class="test-dom" scroll="width:10px; background:#888"></div>'))
var dom = $('.test-dom')
//也可以使用其他的浏览器原始方法,像是:
// var dom = document.getElementsByClassName('test-dom')[0]
//清除
var scroll = richScroll(dom)
$('.clear-btn').click(function(){
scroll.clear()
})
//重新加载
$('.reload-btn').click(function(){
dom.attr('scroll', $('style-input').val())
scroll.reload()
})
}
FAQs
一个兼容到ie8的的滚动条
The npm package rich-scroll-bar receives a total of 1 weekly downloads. As such, rich-scroll-bar popularity was classified as not popular.
We found that rich-scroll-bar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.