Urlhashlistener picking up the wrong item (Owl Carousel)

Asked

Viewed 106 times

1

I’m using Owl Carousel on a Landing page. I added some thumbnails, and used Urlhashlistener to associate the thumbnails to the respective image, but the link is opening the wrong image. It seems that the script is calculating the wrong value, the images are 2 delayed.

is in approval here: http://aresdapraca.itlean.com.br/

inserir a descrição da imagem aqui

  • 1

    You tested taking the Loop ?

  • worked without loop! Will only have this way?

1 answer

1


I discovered the problem. It is a bug of Owl Carousel itself.

You can return the loop.

loop: true.

You can take away those other options:

URLhashListener:true,
startPosition: 'URLHash'

These top two are just to change the URL, the Hash:

#one #two.

Now what you have to do is import this below script file into your code, below the owl.carousel.min.js or owl.carousel.js.

https://rawgit.com/OwlFonk/OwlCarousel2/develop/src/js/owl.hash.js

There is the LINK, but you can save the page as a JS file for you to have the file, because if the LINK breaks you are without.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.