我有两个文件夹Js和zoom_assets .Inside Js,我有文件custom.js,在zoom_assets里面有jquery.smoothZoom.min.js。
custom.js具有打开图像的功能,而jquery.smoothZoom.min.js具有缩放功能。
一旦图像加载,我需要禁用缩放功能。我该怎么做呢??
我正在考虑一旦图像加载,就从custom.js中禁用jquery.smoothZoom.min .js。是否有可能,如果是,如何禁用??
发布于 2013-12-27 15:01:36
好吧。您可能需要一个临时变量来保存图像状态。
var imageLoadStatus = false;
function zoom() {
if (imageLoadStatus == false) {
// do zoom code
imageLoadStatus = true;
}
}
function imageLoadToggle() {
if (imageLoadStatus == false) {
// load Image
imageLoadStatus = true;
} else(imageLoadStatus == true) {
// quit / unload image
imageLoadStatus = false;
}
}https://stackoverflow.com/questions/20796156
复制相似问题