2016-07-05 4 views
0

私は、「カラーボックス」モジュールウィンドウのスライドに何度も絵を作ったカラーボックス付きのスライドショーの問題に関する助けを必要と「フクロウカルーセル」と「カラーボックス」のスライドアクション問題

をowlcarrouselでしょう。 これを実行してモジュールウィンドウを閉じると、私が見ることができる写真をチェックしようとすると、それは異なったものになり、写真の半分だけが表示されます。 わかりやすくするため、私はYouTubeで問題の動画をアップロードしました。

のYouTube:https://youtu.be/uCOkgeoPSh8

ストア:http://www.ks-clothing.click/men/tees-knits-and-polos/lexington-cardigan-sweater-479.html

はまた、私は下のリンクでのアドバイスが、私はスクリプトの中で「アンバインド」を入れ、その後、それは移動しませんでした。 この問題を解決するにはどうすればよいですか?

のstackoverflow:colorbox and preventdefault not working together?

<?php 
$_product = $this->getProduct(); 
$_helper = $this->helper('catalog/output'); 
?> 

<div id="sync1" class="owl-carousel"> 
    <?php $i=0; foreach ($this->getGalleryImages() as $_image): ?> 
     <?php if ($this->isGalleryImageVisible($_image)): ?> 
      <div class="item"> 
       <a class="gallery" href="<?php echo $this->getGalleryImageUrl($_image); ?>">Colorbox</a> 
<!--    <a class="cloud-zoom" rel="position: 'inside' , showTitle: false" href="--><?php //echo $this->getGalleryImageUrl($_image); ?><!--">--> 
        <img src="<?php echo $this->getGalleryImageUrl($_image); ?>" alt="<?php echo $this->escapeHtml($this->getImageLabel()) ?>" title="<?php echo $this->escapeHtml($this->getImageLabel()); ?>" /> 
<!--    </a>--> 
      </div> 
     <?php endif; ?> 
     <?php $i++; endforeach; ?> 
</div> 

<?php if (count($this->getGalleryImages()) > 0): ?> 
    <div id="sync2" class="owl-carousel"> 
     <?php $i=0; foreach ($this->getGalleryImages() as $_image): ?> 
      <?php if ($this->isGalleryImageVisible($_image)): ?> 
       <div class="item"> 
        <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(75); ?>" width="75" height="75" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>" /> 
       </div> 
      <?php endif; ?> 
      <?php $i++; endforeach; ?> 
    </div> 
<?php endif; ?> 

<script type="text/javascript"> 
    //<![CDATA[ 
    jQuery(function ($) { 
     $("a.gallery").unbind('click').colorbox({ 
      rel:'slideshow', 
      transition:'none', 
      maxWidth:'100%', 
      maxHeight:"100%", 
      opacity: 0.5 
     }); 
    }); 
    //]]> 
</script> 

<script type="text/javascript"> 
    //<![CDATA[ 
    jQuery(function($) { 

      var sync1 = jQuery("#sync1"); 
      var sync2 = jQuery("#sync2"); 

      sync1.owlCarousel({ 
       singleItem : true, 
       slideSpeed : 1000, 
       navigation: true, 
       pagination:false, 
       afterAction : syncPosition, 
       responsiveRefreshRate : 200, 
      }); 

      sync2.owlCarousel({ 
       items : 15, 
       itemsDesktop  : [1199,10], 
       itemsDesktopSmall  : [979,10], 
       itemsTablet  : [768,8], 
       itemsMobile  : [479,4], 
       pagination:false, 
       responsiveRefreshRate : 100, 
       afterInit : function(el){ 
        el.find(".owl-item").eq(0).addClass("synced"); 
       } 
      }); 

      function syncPosition(el){ 
       var current = this.currentItem; 
       jQuery("#sync2") 
        .find(".owl-item") 
        .removeClass("synced") 
        .eq(current) 
        .addClass("synced") 
       if(jQuery("#sync2").data("owlCarousel") !== undefined){ 
        center(current) 
       } 
      } 

      jQuery("#sync2").on("click", ".owl-item", function(e){ 
       e.preventDefault(); 
       var number = jQuery(this).data("owlItem"); 
       sync1.trigger("owl.goTo",number); 
      }); 

      function center(number){ 
       var sync2visible = sync2.data("owlCarousel").owl.visibleItems; 
       var num = number; 
       var found = false; 
       for(var i in sync2visible){ 
        if(num === sync2visible[i]){ 
         var found = true; 
        } 
       } 

       if(found===false){ 
        if(num>sync2visible[sync2visible.length-1]){ 
         sync2.trigger("owl.goTo", num - sync2visible.length+2) 
        }else{ 
         if(num - 1 === -1){ 
          num = 0; 
         } 
         sync2.trigger("owl.goTo", num); 
        } 
       } else if(num === sync2visible[sync2visible.length-1]){ 
        sync2.trigger("owl.goTo", sync2visible[1]) 
       } else if(num === sync2visible[0]){ 
        sync2.trigger("owl.goTo", num-1) 
       } 

      } 
    }); 
    //]]> 
</script> 

答えて

0

あなたはそのようなカラーボックスのオプションにreturnFocus: falseを追加する必要があります。

$("a.gallery").unbind('click').colorbox({ 
      rel:'slideshow', 
      transition:'none', 
      maxWidth:'100%', 
      maxHeight:"100%", 
      opacity: 0.5, 
      returnFocus: false 
     }); 

フォーカスリターンは何とか確かに予想外であるフクロウのスライダーを、混乱させる。

関連する問題