简体   繁体   中英

jquery force resize image within div

Looking for force an image size of an image within a jquery zoom div.

I have tried hard coding the height and width with no avail.

Here is the zoom live: http://totallypleasured.co.uk/product_info.php?products_id=1876

Click on the 3rd thumbnail to see the issue when you hover over the image within the div. The image is too small therefore it is repeated 4 times. I need to force the image size larger than the image zoon div to fix the issue.

here is the code that is generating the zoomed div.

zoomDiv = appendTo.append(format('<div id="cloud-zoom-big" class="cloud-zoom-big" style="display:none;position:absolute;left:%0px;top:%1px;width:%2px;height:%3px;background-image:url(\'%4\');z-index:99;"></div>', xPos, yPos, w, h, zoomImage.src)).find(':last');

Just add background-size to the css of the div. So something like:

background-size: 320px 320px;

and to make sure it doesn't repeat use:

background-repeat:no-repeat;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM