change owl carousel 2 options after setup?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm searching for change owl carousel 2 options after setup more specifically.
I am searching a way to disable drag of parent element of the drag element like this:
$('#carousel').on('drag.owl.carousel', function(event) {
$('.carousel').on('drag.owl.carousel', function(event) {
//disable drag
})
})
$('#carousel').on('dragged.owl.carousel', function(event) {
$('.carousel').on('dragged.owl.carousel', function(event) {
//enable drag
})
})
javascript jquery html5 css3 owl-carousel
add a comment |
I'm searching for change owl carousel 2 options after setup more specifically.
I am searching a way to disable drag of parent element of the drag element like this:
$('#carousel').on('drag.owl.carousel', function(event) {
$('.carousel').on('drag.owl.carousel', function(event) {
//disable drag
})
})
$('#carousel').on('dragged.owl.carousel', function(event) {
$('.carousel').on('dragged.owl.carousel', function(event) {
//enable drag
})
})
javascript jquery html5 css3 owl-carousel
add a comment |
I'm searching for change owl carousel 2 options after setup more specifically.
I am searching a way to disable drag of parent element of the drag element like this:
$('#carousel').on('drag.owl.carousel', function(event) {
$('.carousel').on('drag.owl.carousel', function(event) {
//disable drag
})
})
$('#carousel').on('dragged.owl.carousel', function(event) {
$('.carousel').on('dragged.owl.carousel', function(event) {
//enable drag
})
})
javascript jquery html5 css3 owl-carousel
I'm searching for change owl carousel 2 options after setup more specifically.
I am searching a way to disable drag of parent element of the drag element like this:
$('#carousel').on('drag.owl.carousel', function(event) {
$('.carousel').on('drag.owl.carousel', function(event) {
//disable drag
})
})
$('#carousel').on('dragged.owl.carousel', function(event) {
$('.carousel').on('dragged.owl.carousel', function(event) {
//enable drag
})
})
javascript jquery html5 css3 owl-carousel
javascript jquery html5 css3 owl-carousel
edited Aug 16 '14 at 10:20
rene
33.9k1181111
33.9k1181111
asked Aug 16 '14 at 10:12
gauvain robertgauvain robert
63225
63225
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
Rather than try to disable the drag via hooking into the drag events, it would be better to use the owl.reinit() function, along with the touchDrag and mouseDrag options. For instance, if you had a carousel #carousel:
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel'); # Your DOM element gets an 'owlCarousel' data property containing the Owl object.
owl.reinit({touchDrag: false, mouseDrag: false;});
Although the method is named reinit, it won't blank any of your previously-set options.
1
ok but how do you reinit in the seond version of the carousel
– gauvain robert
Aug 16 '14 at 11:31
If you have two carousels, then they'll be in separate DOM elements. Each one will have its ownowlobject that you can access via.data('owlCarousel'). You can callreinit()on both, and it will only affect that particular carousel. You can also callreinit()multiple times on the same one, if you want to toggle dragging on and off.
– Alex P
Aug 16 '14 at 11:34
5
@AlexP I think he was referring to version 2 of the plugin rather than 2 carousels. There doesn't seem to be a reinit method in v2
– Andy
Jan 22 '15 at 10:04
@Andy is absolutely right. this is not an answer to the question, as It clearly addresses the first version, not the second. All software improve as the version number increases, this one seems to go in opposite direction!
– Trix
Feb 15 '16 at 23:28
1
The link to owlCarousel documentation in the post leads to spam page and should be changed/removed (as at 11 Oct 2017)
– RickL
Oct 11 '17 at 13:23
add a comment |
None of solutions above work for me on owl carousel 2.2.
I wanted to change stagePadding on init and resize event.
My solution :
var owl = $('.page-item-gal');
owl.owlCarousel({
...
onResized : setStagePaddingOC,
});
function setStagePaddingOC()
{
var carousel = owl.data('owl.carousel');
var StgPad = ($( window ).width() - owl.parent().parent().find('.width-helper').width()) / 2;
carousel.settings.stagePadding = StgPad;
carousel.options.stagePadding = StgPad;
owl.trigger('refresh.owl.carousel');
}
setStagePaddingOC(); // onInitialized doesn't work
Verified this solution works in version 2.2.1.
– Jason
Apr 18 '17 at 17:13
add a comment |
It looks like the API of Owl 2.0 is a moving target, so the call may depend on what version you're on. For me it's:
$('.carousel').trigger('changeOption.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
But for you it may be something like:
$('.carousel').trigger('change', { property: { name: 'mouseDrag', value: false } });
Or
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
So all together it may look like:
$('#carousel').on('drag.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
}).on('dragged.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: true,
touchDrag: true,
pullDrag: true
});
});
add a comment |
owl.trigger('refresh.owl.carousel');
best option to reinit & update
add a comment |
yes owl carousel version 2 ..
this works for me ( acces options directly )
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel');
w = $( window ).width();
var animateStyle = 'fadeOut';
if(w <= 768){
animateStyle = false;
}
owl.options.animateOut = animateStyle;
3
It doesn't work for me
– Parhum
Dec 15 '15 at 8:55
add a comment |
The answers above didnt work for me but this did:
var $carousel = jQuery('#owl-carousel-block');
var carouselData = $carousel.data();
var carouselOptions = carouselData['owl.carousel'].options;
carouselOptions.loop = true;
$carousel.trigger('refresh.owl.carousel');
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f25339140%2fchange-owl-carousel-2-options-after-setup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
Rather than try to disable the drag via hooking into the drag events, it would be better to use the owl.reinit() function, along with the touchDrag and mouseDrag options. For instance, if you had a carousel #carousel:
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel'); # Your DOM element gets an 'owlCarousel' data property containing the Owl object.
owl.reinit({touchDrag: false, mouseDrag: false;});
Although the method is named reinit, it won't blank any of your previously-set options.
1
ok but how do you reinit in the seond version of the carousel
– gauvain robert
Aug 16 '14 at 11:31
If you have two carousels, then they'll be in separate DOM elements. Each one will have its ownowlobject that you can access via.data('owlCarousel'). You can callreinit()on both, and it will only affect that particular carousel. You can also callreinit()multiple times on the same one, if you want to toggle dragging on and off.
– Alex P
Aug 16 '14 at 11:34
5
@AlexP I think he was referring to version 2 of the plugin rather than 2 carousels. There doesn't seem to be a reinit method in v2
– Andy
Jan 22 '15 at 10:04
@Andy is absolutely right. this is not an answer to the question, as It clearly addresses the first version, not the second. All software improve as the version number increases, this one seems to go in opposite direction!
– Trix
Feb 15 '16 at 23:28
1
The link to owlCarousel documentation in the post leads to spam page and should be changed/removed (as at 11 Oct 2017)
– RickL
Oct 11 '17 at 13:23
add a comment |
Rather than try to disable the drag via hooking into the drag events, it would be better to use the owl.reinit() function, along with the touchDrag and mouseDrag options. For instance, if you had a carousel #carousel:
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel'); # Your DOM element gets an 'owlCarousel' data property containing the Owl object.
owl.reinit({touchDrag: false, mouseDrag: false;});
Although the method is named reinit, it won't blank any of your previously-set options.
1
ok but how do you reinit in the seond version of the carousel
– gauvain robert
Aug 16 '14 at 11:31
If you have two carousels, then they'll be in separate DOM elements. Each one will have its ownowlobject that you can access via.data('owlCarousel'). You can callreinit()on both, and it will only affect that particular carousel. You can also callreinit()multiple times on the same one, if you want to toggle dragging on and off.
– Alex P
Aug 16 '14 at 11:34
5
@AlexP I think he was referring to version 2 of the plugin rather than 2 carousels. There doesn't seem to be a reinit method in v2
– Andy
Jan 22 '15 at 10:04
@Andy is absolutely right. this is not an answer to the question, as It clearly addresses the first version, not the second. All software improve as the version number increases, this one seems to go in opposite direction!
– Trix
Feb 15 '16 at 23:28
1
The link to owlCarousel documentation in the post leads to spam page and should be changed/removed (as at 11 Oct 2017)
– RickL
Oct 11 '17 at 13:23
add a comment |
Rather than try to disable the drag via hooking into the drag events, it would be better to use the owl.reinit() function, along with the touchDrag and mouseDrag options. For instance, if you had a carousel #carousel:
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel'); # Your DOM element gets an 'owlCarousel' data property containing the Owl object.
owl.reinit({touchDrag: false, mouseDrag: false;});
Although the method is named reinit, it won't blank any of your previously-set options.
Rather than try to disable the drag via hooking into the drag events, it would be better to use the owl.reinit() function, along with the touchDrag and mouseDrag options. For instance, if you had a carousel #carousel:
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel'); # Your DOM element gets an 'owlCarousel' data property containing the Owl object.
owl.reinit({touchDrag: false, mouseDrag: false;});
Although the method is named reinit, it won't blank any of your previously-set options.
edited Mar 8 '18 at 11:07
Community♦
11
11
answered Aug 16 '14 at 11:03
Alex PAlex P
5,12321427
5,12321427
1
ok but how do you reinit in the seond version of the carousel
– gauvain robert
Aug 16 '14 at 11:31
If you have two carousels, then they'll be in separate DOM elements. Each one will have its ownowlobject that you can access via.data('owlCarousel'). You can callreinit()on both, and it will only affect that particular carousel. You can also callreinit()multiple times on the same one, if you want to toggle dragging on and off.
– Alex P
Aug 16 '14 at 11:34
5
@AlexP I think he was referring to version 2 of the plugin rather than 2 carousels. There doesn't seem to be a reinit method in v2
– Andy
Jan 22 '15 at 10:04
@Andy is absolutely right. this is not an answer to the question, as It clearly addresses the first version, not the second. All software improve as the version number increases, this one seems to go in opposite direction!
– Trix
Feb 15 '16 at 23:28
1
The link to owlCarousel documentation in the post leads to spam page and should be changed/removed (as at 11 Oct 2017)
– RickL
Oct 11 '17 at 13:23
add a comment |
1
ok but how do you reinit in the seond version of the carousel
– gauvain robert
Aug 16 '14 at 11:31
If you have two carousels, then they'll be in separate DOM elements. Each one will have its ownowlobject that you can access via.data('owlCarousel'). You can callreinit()on both, and it will only affect that particular carousel. You can also callreinit()multiple times on the same one, if you want to toggle dragging on and off.
– Alex P
Aug 16 '14 at 11:34
5
@AlexP I think he was referring to version 2 of the plugin rather than 2 carousels. There doesn't seem to be a reinit method in v2
– Andy
Jan 22 '15 at 10:04
@Andy is absolutely right. this is not an answer to the question, as It clearly addresses the first version, not the second. All software improve as the version number increases, this one seems to go in opposite direction!
– Trix
Feb 15 '16 at 23:28
1
The link to owlCarousel documentation in the post leads to spam page and should be changed/removed (as at 11 Oct 2017)
– RickL
Oct 11 '17 at 13:23
1
1
ok but how do you reinit in the seond version of the carousel
– gauvain robert
Aug 16 '14 at 11:31
ok but how do you reinit in the seond version of the carousel
– gauvain robert
Aug 16 '14 at 11:31
If you have two carousels, then they'll be in separate DOM elements. Each one will have its own
owl object that you can access via .data('owlCarousel'). You can call reinit() on both, and it will only affect that particular carousel. You can also call reinit() multiple times on the same one, if you want to toggle dragging on and off.– Alex P
Aug 16 '14 at 11:34
If you have two carousels, then they'll be in separate DOM elements. Each one will have its own
owl object that you can access via .data('owlCarousel'). You can call reinit() on both, and it will only affect that particular carousel. You can also call reinit() multiple times on the same one, if you want to toggle dragging on and off.– Alex P
Aug 16 '14 at 11:34
5
5
@AlexP I think he was referring to version 2 of the plugin rather than 2 carousels. There doesn't seem to be a reinit method in v2
– Andy
Jan 22 '15 at 10:04
@AlexP I think he was referring to version 2 of the plugin rather than 2 carousels. There doesn't seem to be a reinit method in v2
– Andy
Jan 22 '15 at 10:04
@Andy is absolutely right. this is not an answer to the question, as It clearly addresses the first version, not the second. All software improve as the version number increases, this one seems to go in opposite direction!
– Trix
Feb 15 '16 at 23:28
@Andy is absolutely right. this is not an answer to the question, as It clearly addresses the first version, not the second. All software improve as the version number increases, this one seems to go in opposite direction!
– Trix
Feb 15 '16 at 23:28
1
1
The link to owlCarousel documentation in the post leads to spam page and should be changed/removed (as at 11 Oct 2017)
– RickL
Oct 11 '17 at 13:23
The link to owlCarousel documentation in the post leads to spam page and should be changed/removed (as at 11 Oct 2017)
– RickL
Oct 11 '17 at 13:23
add a comment |
None of solutions above work for me on owl carousel 2.2.
I wanted to change stagePadding on init and resize event.
My solution :
var owl = $('.page-item-gal');
owl.owlCarousel({
...
onResized : setStagePaddingOC,
});
function setStagePaddingOC()
{
var carousel = owl.data('owl.carousel');
var StgPad = ($( window ).width() - owl.parent().parent().find('.width-helper').width()) / 2;
carousel.settings.stagePadding = StgPad;
carousel.options.stagePadding = StgPad;
owl.trigger('refresh.owl.carousel');
}
setStagePaddingOC(); // onInitialized doesn't work
Verified this solution works in version 2.2.1.
– Jason
Apr 18 '17 at 17:13
add a comment |
None of solutions above work for me on owl carousel 2.2.
I wanted to change stagePadding on init and resize event.
My solution :
var owl = $('.page-item-gal');
owl.owlCarousel({
...
onResized : setStagePaddingOC,
});
function setStagePaddingOC()
{
var carousel = owl.data('owl.carousel');
var StgPad = ($( window ).width() - owl.parent().parent().find('.width-helper').width()) / 2;
carousel.settings.stagePadding = StgPad;
carousel.options.stagePadding = StgPad;
owl.trigger('refresh.owl.carousel');
}
setStagePaddingOC(); // onInitialized doesn't work
Verified this solution works in version 2.2.1.
– Jason
Apr 18 '17 at 17:13
add a comment |
None of solutions above work for me on owl carousel 2.2.
I wanted to change stagePadding on init and resize event.
My solution :
var owl = $('.page-item-gal');
owl.owlCarousel({
...
onResized : setStagePaddingOC,
});
function setStagePaddingOC()
{
var carousel = owl.data('owl.carousel');
var StgPad = ($( window ).width() - owl.parent().parent().find('.width-helper').width()) / 2;
carousel.settings.stagePadding = StgPad;
carousel.options.stagePadding = StgPad;
owl.trigger('refresh.owl.carousel');
}
setStagePaddingOC(); // onInitialized doesn't work
None of solutions above work for me on owl carousel 2.2.
I wanted to change stagePadding on init and resize event.
My solution :
var owl = $('.page-item-gal');
owl.owlCarousel({
...
onResized : setStagePaddingOC,
});
function setStagePaddingOC()
{
var carousel = owl.data('owl.carousel');
var StgPad = ($( window ).width() - owl.parent().parent().find('.width-helper').width()) / 2;
carousel.settings.stagePadding = StgPad;
carousel.options.stagePadding = StgPad;
owl.trigger('refresh.owl.carousel');
}
setStagePaddingOC(); // onInitialized doesn't work
answered Feb 17 '17 at 15:06
Fabien CharrasseFabien Charrasse
314
314
Verified this solution works in version 2.2.1.
– Jason
Apr 18 '17 at 17:13
add a comment |
Verified this solution works in version 2.2.1.
– Jason
Apr 18 '17 at 17:13
Verified this solution works in version 2.2.1.
– Jason
Apr 18 '17 at 17:13
Verified this solution works in version 2.2.1.
– Jason
Apr 18 '17 at 17:13
add a comment |
It looks like the API of Owl 2.0 is a moving target, so the call may depend on what version you're on. For me it's:
$('.carousel').trigger('changeOption.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
But for you it may be something like:
$('.carousel').trigger('change', { property: { name: 'mouseDrag', value: false } });
Or
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
So all together it may look like:
$('#carousel').on('drag.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
}).on('dragged.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: true,
touchDrag: true,
pullDrag: true
});
});
add a comment |
It looks like the API of Owl 2.0 is a moving target, so the call may depend on what version you're on. For me it's:
$('.carousel').trigger('changeOption.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
But for you it may be something like:
$('.carousel').trigger('change', { property: { name: 'mouseDrag', value: false } });
Or
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
So all together it may look like:
$('#carousel').on('drag.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
}).on('dragged.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: true,
touchDrag: true,
pullDrag: true
});
});
add a comment |
It looks like the API of Owl 2.0 is a moving target, so the call may depend on what version you're on. For me it's:
$('.carousel').trigger('changeOption.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
But for you it may be something like:
$('.carousel').trigger('change', { property: { name: 'mouseDrag', value: false } });
Or
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
So all together it may look like:
$('#carousel').on('drag.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
}).on('dragged.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: true,
touchDrag: true,
pullDrag: true
});
});
It looks like the API of Owl 2.0 is a moving target, so the call may depend on what version you're on. For me it's:
$('.carousel').trigger('changeOption.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
But for you it may be something like:
$('.carousel').trigger('change', { property: { name: 'mouseDrag', value: false } });
Or
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
So all together it may look like:
$('#carousel').on('drag.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: false,
touchDrag: false,
pullDrag: false
});
}).on('dragged.owl.carousel', function() {
$('.carousel').trigger('change.owl.carousel', {
mouseDrag: true,
touchDrag: true,
pullDrag: true
});
});
answered Mar 2 '16 at 15:36
BeauBeau
1,57011418
1,57011418
add a comment |
add a comment |
owl.trigger('refresh.owl.carousel');
best option to reinit & update
add a comment |
owl.trigger('refresh.owl.carousel');
best option to reinit & update
add a comment |
owl.trigger('refresh.owl.carousel');
best option to reinit & update
owl.trigger('refresh.owl.carousel');
best option to reinit & update
answered Sep 7 '18 at 9:46
Chirag PipariyaChirag Pipariya
309313
309313
add a comment |
add a comment |
yes owl carousel version 2 ..
this works for me ( acces options directly )
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel');
w = $( window ).width();
var animateStyle = 'fadeOut';
if(w <= 768){
animateStyle = false;
}
owl.options.animateOut = animateStyle;
3
It doesn't work for me
– Parhum
Dec 15 '15 at 8:55
add a comment |
yes owl carousel version 2 ..
this works for me ( acces options directly )
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel');
w = $( window ).width();
var animateStyle = 'fadeOut';
if(w <= 768){
animateStyle = false;
}
owl.options.animateOut = animateStyle;
3
It doesn't work for me
– Parhum
Dec 15 '15 at 8:55
add a comment |
yes owl carousel version 2 ..
this works for me ( acces options directly )
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel');
w = $( window ).width();
var animateStyle = 'fadeOut';
if(w <= 768){
animateStyle = false;
}
owl.options.animateOut = animateStyle;
yes owl carousel version 2 ..
this works for me ( acces options directly )
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel');
w = $( window ).width();
var animateStyle = 'fadeOut';
if(w <= 768){
animateStyle = false;
}
owl.options.animateOut = animateStyle;
answered Oct 7 '14 at 8:24
Michal OrlíkMichal Orlík
41143
41143
3
It doesn't work for me
– Parhum
Dec 15 '15 at 8:55
add a comment |
3
It doesn't work for me
– Parhum
Dec 15 '15 at 8:55
3
3
It doesn't work for me
– Parhum
Dec 15 '15 at 8:55
It doesn't work for me
– Parhum
Dec 15 '15 at 8:55
add a comment |
The answers above didnt work for me but this did:
var $carousel = jQuery('#owl-carousel-block');
var carouselData = $carousel.data();
var carouselOptions = carouselData['owl.carousel'].options;
carouselOptions.loop = true;
$carousel.trigger('refresh.owl.carousel');
add a comment |
The answers above didnt work for me but this did:
var $carousel = jQuery('#owl-carousel-block');
var carouselData = $carousel.data();
var carouselOptions = carouselData['owl.carousel'].options;
carouselOptions.loop = true;
$carousel.trigger('refresh.owl.carousel');
add a comment |
The answers above didnt work for me but this did:
var $carousel = jQuery('#owl-carousel-block');
var carouselData = $carousel.data();
var carouselOptions = carouselData['owl.carousel'].options;
carouselOptions.loop = true;
$carousel.trigger('refresh.owl.carousel');
The answers above didnt work for me but this did:
var $carousel = jQuery('#owl-carousel-block');
var carouselData = $carousel.data();
var carouselOptions = carouselData['owl.carousel'].options;
carouselOptions.loop = true;
$carousel.trigger('refresh.owl.carousel');
answered Nov 16 '18 at 16:32
b3wiib3wii
456313
456313
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f25339140%2fchange-owl-carousel-2-options-after-setup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown