Owlcarousel2: Problem with dotData custom Pagination carousel navigation

Created on 6 Feb 2015  路  4Comments  路  Source: OwlCarousel2/OwlCarousel2

Hi, working with @version 2.0.0 and I am trying to create some custom dots navigation.
Basically a no-brainer but it doesn't work, nothing goes into my Dots elements.
Once the dotData param gets removed the regular dots appear and everything works like a charm... Has support for that param been discontinued or am I doing smth stupid? Thanks!




md5-84693b7c710ed4ca3227450660bb369b



$(".custom_slides").owlCarousel({
        items:1,
        dotData:true,
});
task

Most helpful comment

Just a hack:

In your html document, define a new container with a specific class (let's say <div class="dotsCont">) and add it as many children containers as your slides number is. Then, in the carousel settings, define the dotsContainer to point at your div class.

This way you'll be able to achieve a custom navigation without using the 'URLhashListener' option, still having whatever content you want on each "dot" and an 'active' class properly working on each of it.

Example:

HTML

<div class="dotsCont">
  <div>Fake Dot 1</div>
  <div>Fake Dot 2</div>
  <div>Fake Dot 3</div>
</div>
<div class="owl-carouse">
  <div>Slide 1 content</div>
  <div>Slide 2 content</div>
  <div>Slide 3 content</div>
</div>

JS

$(".owl-carousel").owlCarousel({
  dotsContainer: '.dotsCont'
});

All 4 comments

This doesn't appear to be implemented. We should either add it or remove it from docs

Just a hack:

In your html document, define a new container with a specific class (let's say <div class="dotsCont">) and add it as many children containers as your slides number is. Then, in the carousel settings, define the dotsContainer to point at your div class.

This way you'll be able to achieve a custom navigation without using the 'URLhashListener' option, still having whatever content you want on each "dot" and an 'active' class properly working on each of it.

Example:

HTML

<div class="dotsCont">
  <div>Fake Dot 1</div>
  <div>Fake Dot 2</div>
  <div>Fake Dot 3</div>
</div>
<div class="owl-carouse">
  <div>Slide 1 content</div>
  <div>Slide 2 content</div>
  <div>Slide 3 content</div>
</div>

JS

$(".owl-carousel").owlCarousel({
  dotsContainer: '.dotsCont'
});

@adrianpuescu thanks a lot, that solved this problem for me. however it's a hack. hope it will be implemented at next release

if you need counter:

.owl-dots {
counter-reset: counter;
}
.owl-dots > .owl-dot:before {
content: counter(counter);
counter-increment: counter;
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stratboy picture stratboy  路  3Comments

leecollings picture leecollings  路  3Comments

mkraha picture mkraha  路  4Comments

shamimsaj picture shamimsaj  路  3Comments

jhig85 picture jhig85  路  3Comments