jQuery gzoom如何将默认图像大小设置为默认

问题描述:

我正在尝试使用jquery gzoom:

i am attempting to use jquery gzoom:

http://lab.gianiaz.com/jquery/gzoom/

这是我的jquery:

This is my jquery:

 $(".zoom_no_lbox").gzoom({
    sW: 800,
    sH: 500,
    lW: 1600,
    lH: 1000,
    lightbox: true
});

这是我的照片

<div class="zoom zoom_no_lbox" id="zoom02"><img src="uploads/007/pg_0009.jpeg" alt="007" class=" "></div>

但是正如您在gzoom功能中所看到的,我已经输入了图像的大小.但是,页面上的图像是动态加载的,并且默认长度可能会有所不同.那么如何将默认值设置为图像的默认值呢?

but as you can see in the gzoom function i have put in the size of the image. However, the images on the page are loaded dynamically and can vary in default length. So how can i set the default to be the default of the image?

请先为您的图片提供一个ID,然后再提供

firstly give your image an id and after that

$('#ImageId').load(function(){
$(".zoom_no_lbox").gzoom({
    sW: value,
    sH: value,
    lW: value,
    lH: value,
    lightbox: true
});
});

尝试通过获取图像的属性在此处设置值

try to set value here by getting attributes of image