交换后缩放

时间:2015-03-07 21:09:07

标签: swap

交换后不工作变焦 在缩放显示旧图像时单击附加图像 我究竟做错了什么  交换后不工作变焦 在缩放显示旧图像时单击附加图像 我做错了什么      “>                                    

  • “>” 中data-zoom-image =“”title =“”alt =“”/>“>
  •                                    “title =”“>”title =“”alt =“”/>                                             

        <script>
        $(document).ready(function(){
    
        // Get main image info
        var img = $('#zoom_01').attr('src'); // get img popup href
        if (img != undefined) {
        var imgWidth = img.substring(img.lastIndexOf('-') + 1, img.lastIndexOf('x'));
        var imgHeight = img.substring(img.lastIndexOf('x') + 1, img.lastIndexOf('.'));
        }
    
        $('.image-additional img').hover(function() {
        var newsrc = $(this).parent().attr('href');
    
        $('#zoom_01').attr({
        src: newsrc,
        title: $(this).attr('title'),
        alt: $(this).attr('alt'),
        width: imgWidth,
        height: imgHeight
        });
    
        $('#zoom_01').parent().attr('href', newsrc);
        });
        });
        </script>
    

    1 个答案:

    答案 0 :(得分:0)

    <div class="<?php echo $class; ?>">
      <?php if ($thumb || $images) { ?>
      <ul class="thumbnails">
        <?php if ($thumb) { ?>
        <li><div class="thumbnail" title="<?php echo $heading_title; ?>"><img id="zoom_01" src="<?php echo $thumb; ?>" data-zoom-image="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /><a href="<?php echo $popup; ?>"><i class="fa fa-search"></i></a></div></li>
        <?php } ?>
        <?php if ($images) { ?>
        <?php foreach ($images as $image) { ?>
        <li class="image-additional"><a class="thumbnail" href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>"> <img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a></li>
        <?php } ?>
        <?php } ?>
      </ul>
      <?php } ?>
    </div>