在ajax更新多个图像后,对模型进行缩放

时间:2022-01-26 00:24:31

Using a Hotcakes Commerce module for dotnetnuke.zoom image working correctly when product has one image. The jQuery library used for zoom is elevateweb.co. (Added Zoom to product view with this tutorial) In product.js code has been updated also

为dotnetnuke使用一个Hotcakes商业模块。当产品只有一个图像时,可正确放大图像。用于zoom的jQuery库是highateweb.co。(在本教程中添加缩放到产品视图)在产品中。js代码也已经更新

$('#hcProductImage').attr('src', data.MediumImageUrl);
$('#hcProductImage').attr('data-zoom-image', data.MediumImageUrl);
$('#hcProductImage').elevateZoom({easing : true});
$('#hcSku').html(data.Sku);

data-zoom-image attrib of image source updated correctly , but zoom show previous image after change model of product. after changing data-zoom-image attrib of image elevateZoom function has been called to update zoom . but no change.

数据缩放-图像attrib对图像源进行了正确的更新,但缩放后显示的是之前的图像。在改变了数据缩放后,调用图像升降缩放函数attrib来更新缩放。但是没有改变。

1 个解决方案

#1


2  

I'm not familiar with Hotcakes Commerce. But I think you have to re-bind the background image of the zoomed DIV.

我不熟悉月饼贸易。但是我认为你必须重新绑定缩放DIV的背景图像。

$('.zoomWindowContainer .zoomWindow').css({ 'background-image': 'url(\'' + data.MediumImageUrl + '\')' });

This probably works best with same size images.

这可能对相同大小的图像最有效。

#1


2  

I'm not familiar with Hotcakes Commerce. But I think you have to re-bind the background image of the zoomed DIV.

我不熟悉月饼贸易。但是我认为你必须重新绑定缩放DIV的背景图像。

$('.zoomWindowContainer .zoomWindow').css({ 'background-image': 'url(\'' + data.MediumImageUrl + '\')' });

This probably works best with same size images.

这可能对相同大小的图像最有效。