Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
dom scroller based on zynga scroller
http://localhost:6006/examples/
online example: http://yiminghe.github.io/zscroller/
interface ViewportSize {
width: number;
height: number;
}
interface ContentSize {
width: number;
height: number;
}
interface X {
// scrollbar x size
width: number;
height?: number;
scrollbar?: {
style: any;
};
indicator?: {
style: any;
};
}
interface Y {
width?: number;
// scrollbar y height
height: number;
scrollbar?: {
style: any;
};
indicator?: {
style: any;
};
}
// minZoom defaults to 0.1
// maxZoom defaults to 10
// locking defaults to true
// defaultScrollX defaults to 0
// defaultScrollY defaults to 0
// defaultZoom defaults to 1
interface IZScrollerOption {
minZoom?: number;
maxZoom?: number;
minIndicatorSize?: number;
zooming?: boolean;
locking?: boolean;
viewport: IViewportSize;
content: IContentSize;
x?: X;
y?: Y;
defaultScrollX?:number;
defaultScrollY?:number;
defaultZoom?:number;
container?: HTMLElement;
scrollingComplete?: () => any;
onScroll?: (x: number, y: number, zoom: number) => any;
}
declare class ZScroller {
constructor(_options: ZScrollerOption);
scrollTo(x: number, y: number, animate: boolean): void;
scrollBy(x: number, y: number, animate: boolean): void;
getScrollbar(type: any): HTMLElement;
getScrollPosition(): {x:number;y:number;};
setDisabled(disabled: any): void;
// relayout
setDimensions({ viewport, content, x, y, }?: {
viewport?: ViewportSize;
content?: ContentSize;
x?: X;
y?: Y;
}): void;
destroy(): void;
}
import ZScroller from 'zscroller';
const zscroller = new ZScroller({
container: container,
viewport: {
height: container.clientHeight - 20, // padding
width: container.clientWidth - 20,
},
content: {
width: content.offsetWidth,
height: content.offsetHeight
},
x: {
width: container.current.clientWidth - 4, // padding
},
y: {
height: container.current.clientHeight - 4, // padding
},
onScroll(left, top) {
content.style.transform = `translate3d(${-left}px,${-top}px,0)`
content.style.webkitTransform = `translate3d(${-left}px,${-top}px,0)`;
}
});
container.appendChild(zscroller.getScrollbar('x'));
container.appendChild(zscroller.getScrollbar('y'));
zscroller is released under the MIT license.
FAQs
dom scroller based on zynga scroller
The npm package zscroller receives a total of 16,156 weekly downloads. As such, zscroller popularity was classified as popular.
We found that zscroller 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.