76
rated 0 times
[
77]
[
1]
/ answers: 1 / hits: 19671
/ 8 Years ago, sun, april 3, 2016, 12:00:00
I have a owl carousel with 3 items, the carousel displays one item per page.
Inside each item I have html inputs.
I want to programmatically change the active item so I can make focus on input inside it.
Here is the initial configuration:
var owl = $(#selector).owlCarousel({
slideSpeed: 300,
paginationSpeed: 400,
items: 1,
itemsDesktop: false,
itemsDesktopSmall: false,
itemsTablet: false,
itemsMobile: false,
dots: false,
touchDrag: false,
mouseDrag: false
});
And the html looks like this:
<div id=selector class=owl-carousel owl-theme>
<div class=item>
<input type=text name=name1 id=input1>
</div>
<div class=item>
<input type=text name=name2 id=input2>
</div>
<div class=item>
<input type=text name=name3 id=input3>
</div>
</div>
For example: if I want to make focus on input3, I have to set the current page to 3 and then set the focus.
More From » jquery