jQuery gzoom如何将默认图像大小设置为默认 [英] jquery gzoom how to set default image size to defualt
本文介绍了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
这篇关于jQuery gzoom如何将默认图像大小设置为默认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文