Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
fixedsticky
Advanced tools
sticky组件,支持吸顶效果
实例方法为:
new lib.sticky(element, options)
或者把element
放到options
中做为一个属性:
new lib.sticky(options)
element
:一个DOM元素,或者是它的CSS选择器
top
:(非必填)吸顶时元素距离视口顶部的高度,默认值为0
withinParent
:(非必填,仅适用于Android)元素的sticky效果是否限制在父元素中,默认值为false
init
:初始化实例
destroy
:销毁实例
refresh
:重置实例,如果withinParent
设置为true
,且父元素高度发生变化,请立即调用此方法
在iOS上,由于scroll事件只有在滚动停止时才触发,所以使用原生sticky(兼容性)实现完美的吸顶效果。
Android不支持原生sticky,使用监听scroll事件 + fixed和absolute + 一个占位元素模拟。
在使用lib.sticky组件时,为了兼容原生sticky的效果:
DOM结构必须严格遵守:
<div class="parent">
<div class="sticky"></div>
</div>
对于sticky元素:
对于父级元素:
更多参考资料:
其他:
FAQs
sticky吸顶组件
The npm package fixedsticky receives a total of 3 weekly downloads. As such, fixedsticky popularity was classified as not popular.
We found that fixedsticky 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.