繁体   English   中英

magento 1.9.1.0 elevateZoom无法在自定义主题上首次加载/工作

[英]magento 1.9.1.0 elevateZoom not loaded/working first time on custom theme

我正在使用1.9.1.0和自定义主题(购物者主题)

我已经复制了media.phtml和app.js等(来自rwd)用于缩放目的

第一次没有加载缩放,但是当我单击缩略图(更多视图)时,elevateZoom加载正确,我也发现该人的第二张图像首先加载

显然,尽管我使用自定义主题,但我必须手动执行两件事1)在“产品详细信息”页面中,将首先加载第一个图像(基本图像)2)并同时加载elevateZoom

但是我没有找到我通过jquery更改代码的页面

尝试查看以下文件: (/skin/frontend/rwd/default/js/app.js)并查找image.elevateZoom();然后检查是否已注释,如果删除,则删除注释并再次运行。

对于已经没有冲突设置但仍然遇到问题的任何人,我终于在Github获得的罚单上找到了该解决方案

// First call elevateZoom

$j(document).ready(function() {     
  $j('.product-image-thumbs').attr('id', 'zoomGallery');

  //initiate the plugin and pass the id of the div containing gallery images 

  $j("#image-main").elevateZoom({gallery:'zoomGallery', cursor: 'pointer', galleryActiveClass: 'active', imageCrossfade: true, loadingIcon: 'http://www.elevateweb.co.uk/spinner.gif'}); 

 //pass the images to Fancybox 

 $j("#image-main").bind("click", function(e) { 
    var ez = $j('#image-main').data('elevateZoom');    
    $j.fancybox(ez.getGalleryList()); 
    return false; 
 }); 

// after click you need to remove the current zoom 

$j(".product-image-thumbs li img").click(function(){
    $j("#image-main").attr("src", $j(this).attr("data-main-image-src"));
    $j('.zoomContainer').remove();
    $j('#image-main').removeData('elevateZoom');

// and then call it again

$j('#image-main').elevateZoom({
    gallery: 'more-vies',
    lensSize: 200,
    cursor: 'pointer',
    galleryActiveClass: 'active',
    imageCrossfade: true,
    scrollZoom : true,
    responsive: true
  });
});
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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