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.
@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.
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.