Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@mand-mobile/scroller
Advanced tools
Platform-independent virtual scrolling computing engine
class Scroller {
constructor(
wrapper: HTMLElement | string,
content:HTMLElement | string,
options: ScrollerOptions
) { }
}
import Scroller '@mand-mobile/scroller'
const scroller = new Scroller(wrapper, content)
scroller.setDimensions(
wrapper.getBoundingClientRect(),
content.getBoundingClientRect()
)
scroller.on('translate', (point, styles) => { })
Refer to BetterScroll - options
pending: boolean
Determine whether the current scroller is in the process of scrolling animation
scrollable: {x: boolean, y: boolean}
Determine whether the current scroller can scroll horizontally and vertically
handleStart: (e: TouchEvent) => void
handleMove: (e: TouchEvent) => void
handleEnd: (e: TouchEvent) => void
scrollTo: ( x: number, y: number, time = 0, easingFn?: (t: number) => number ) => void
scrollBy: ( deltaX: number, deltaY: number, time = 0, easingFn?: (t: number) => number ) => void
Scroll the distance x, y in the horizontal and vertical directions relative to the current position.
getCurrentPos: () => {x: number, y: number}
setDimensions: ( wrapperRect: DOMRect, contentRect: DOMRect ) => void
Set the scroller wrapper and content rect size.
refresh: () => void
Recalculate the scroller, it must be called to ensure that the scrolling effect is normal when the scrolling area changes.
stopAnimation: () => void
stop the currently running scroll animation immediately.
enable: () => void
disable: () => void
destroy: () => void
Destroy scroller and unbind events.
Before scrolling begins (touchstart triggered)
scroller.on('beforeScrollStart', () => {})
When scrolling starts (touchmove)
scroller.on('scrollStart', () => {})
When touch ends (touchend triggered)
scroller.on('touchEnd', () => {})
When scrolling ends (touchend triggered and momentum finished)
scroller.on('scrollEnd', (point: {x: number, y: number}) => {})
during scrolling
scroller.on('scroll', (point: {x: number, y: number}) => {})
Scrolling is cancelled. For example, if you force a scrolling to stop.
scroller.on('scrollCancel', () => {})
Internal translate triggered during scrolling, generally used to receive transform style information.
scroller.on('translate', (point: {x: number, y: number}, styles: {}) => {})
scroller.on('refresh', () => {})
scroller.on('destroy', () => {})
class WheelScroller {
constructor(scroller: Scroller, options: Options) { }
}
import Scroller from '@mand-mobile/scroller'
import WheelScroller from '@mand-mobile/scroller/lib/wheel'
const scroller = new Scroller(wrapper, content)
scroller.setDimensions(
wrapper.getBoundingClientRect(),
content.getBoundingClientRect()
)
const wheel = new WheelScroller(scroller)
wheelTo: (index = 0, time = 0) => void
getSelectedIndex: () => number
class PullDown {
constructor(scroller: Scroller, options: Options) { }
}
import PullDown from '@mand-mobile/scroller/lib/pull-down'
const scroller = new Scroller(wrapper, content)
scroller.setDimensions(
wrapper.getBoundingClientRect(),
content.getBoundingClientRect()
)
const refresher = new PullDown(scroller)
finish: () => void
triggerPullToRefresh: () => void
scroller.on('pullingDownReady', () => {})
scroller.on('pullingDown', () => {})
class Animator {
constructor() { }
}
import Animator from '@mand-mobile/scroller/lib/animator'
const animatior = new Animator()
const id = animatior.start(
percent => {
console.log(percent)
}
)
animatior.stop(id)
start: (
stepCallback: (percent: number) => void,
verifyCallback: (now: number, id: number) => boolean | null,
completedCallback: (percent: number, id: number, isComplete: boolean) => void | null,
duration?: number,
easingFn?: (t: number) => number
) => number
stop: (id: number) => id
isRunning: (id: number) => id
FAQs
> TODO: description
The npm package @mand-mobile/scroller receives a total of 0 weekly downloads. As such, @mand-mobile/scroller popularity was classified as not popular.
We found that @mand-mobile/scroller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.