Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@mxssfd/img-zoom
Advanced tools
兼容ie9及以上
npm install @mxssfd/img-zoom
或者cdn方式
<script src="https://cdn.jsdelivr.net/npm/mengxinssfd/img-zoom@main/img/"></script>
// 使用该方式需babel编译后才支持ie 或者 import ImgZoom form "@mxssfd/img-zoom/lib-umd"
// 如果项目已使用babel建议使用此方法
import ImgZoom
form
"@mxssfd/img-zoom";
new ImgZoom(options);
或者
<script src="lib-umd/index.js"></script>
<script>
new ImgZoom(options);
</script>
interface scaleOption {
max?: number, // 最大缩放倍数
min?: number, // 最小缩放倍数
step?: number, // 滚轮滚动一次的缩放倍数
default?: number, // 点开图片时显示的缩放倍数
}
// 默认scale
const defaultScale: scaleOption = {
max: 10,
min: 0.1,
step: 0.1,
default: 1,
};
interface options {
triggerImgClass?: string, // 触发显示大图的img的class
isClickViewImgClose?: boolean // 是否点击图片时关闭大图
scale?: scaleOption
}
// 默认options
const defaultOptions: options = {
triggerImgClass: "img-zoom",
isClickViewImgClose: false,
};
// 等于
new ImgZoom({
scale: {
max: 10,
min: 0.1,
step: 0.1,
default: 1,
},
triggerImgClass: "img-zoom",
isClickViewImgClose: false,
});
FAQs
原生ts/js html图片缩放库
The npm package @mxssfd/img-zoom receives a total of 3 weekly downloads. As such, @mxssfd/img-zoom popularity was classified as not popular.
We found that @mxssfd/img-zoom demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.