SSENSE / vue-carousel

A flexible, responsive, touch-friendly carousel for Vue.js
https://ssense.github.io/vue-carousel/
MIT License
1.72k stars 504 forks source link

NavigateTo in another carousel on first load is not working #499

Open clien007 opened 4 years ago

clien007 commented 4 years ago

Hi!

I'm experiencing a bug in navigateTo when I scrolled the first carousel the another carousel is not scrolling on first load, but when element is shown and you hide it the second carousel works fine. I saw the style of it, the transform style is stuck in translate(0px, 0px); when the wrapper of it is hidden. Thank you!

     <carousel :per-page="1"  :mouse-drag="false" :paginationEnabled="false" class="zoom_detailsCarousel" @page-change="pageChanged($event)" :navigateTo="page_no" :loop="true">
       <slide >
                    <img src="image1.jpg">
        </slide>
        <slide >
                    <img src="image2.jpg">
        </slide>
     </carousel>

     <div v-if="is_show">
              <carousel :per-page="1"  :mouse-drag="false" :paginationEnabled="false" class="zoom_detailsCarousel" @page-change="pageChanged($event)" :navigateTo="page_no" :loop="true">
                        <slide >
                                <img src="image1.jpg">
                       </slide>
                       <slide >
                                <img src="image2.jpg">
                       </slide>
              </carousel>
     </div>

     methods:{
              pageChanged(val){
              this.page_no = val;
              console.log(val);
     },