我正在开发Shopify应用。在产品详细信息页面产品图片部分中,我想在悬停而不是onclick
部分中显示图像_initImageSwitch: function() {
if (!Modernizr.touchevents && this.settings.zoomEnabled && e($(this.selectors.productImageWrap)), this.settings.lightboxEnabled) {
var t = this.productSingleObject.images;
StyleHatch.productImageLightboxData = this.settings.productImageLightboxData, $(window).on("resize", function() {
var e = slate.utils.defaultTo(window.devicePixelRatio, 1),
o = $(window).width(),
a = Math.floor(e * o);
StyleHatch.productImageLightboxData = [];
for (var n = 0; n < t.length; n++) {
var i = t[n],
r = theme.Images.getSizedImageUrl(i, a + "x"),
c = {
src: r
};
StyleHatch.productImageLightboxData.push(c)
}
void 0 !== $("#ProductPhoto a").data().magnificPopup && ($("#ProductPhoto").find("a").data().magnificPopup.items = StyleHatch.productImageLightboxData)
}).trigger("resize");