I use owl-carousel with these options:
jQuery('.my-carousel').owlCarousel({
autoplay: true,
autoplayTimeout: 5000,
autoplaySpeed: 3000
});
The carousel will take 3 seconds to switch to the next image, then stay on this image for 2 seconds before starting the next 3-second animation.
What I'm looking for: On page load the first image is displayed for 5 seconds before the animation starts. I want the first interval to take only 2 seconds (or instantly start the animation).
To my knowledge, there is no way of differentiating the first slide from the others in terms of the timing functions. One way of doing this, though, is to disable autoplay and then re-enable it. The first movement will take the full autoplayTimeout value, whilst all subsequent timeouts will have the a autoplaySpeed deducted from them.
jQuery('.my-carousel').owlCarousel({
autoplay: true,
autoplayTimeout: 5000,
autoplaySpeed: 3000
}).trigger("stop.owl.autoplay")
.trigger("play.owl.autoplay");
Related
could you please help me to understand how to make slider I see in "our menu" section of https://livedemo00.template-help.com/wt_61177_v1/#undefined6 site with an infinite loop and same functions.
The exact slider you are looking for is a Slick Auto play slider which is just the auto play version of the example you have. Example code.
$('.autoplay').slick({
slidesToShow: 5, //The amount of slides to be in view at any given time
slidesToScroll: 1, // The amount of slides to scroll on click or auto scoll
autoplay: true, // Sets the slider to automatically slide through the slides
autoplaySpeed: 2000, // The interval between sliding between slides
});
Example image of slider on slicks website:
I'm trying to shorten the speed of the autoplay on an owl carousel (I'm using owl carousel 1), but it's always stuck at 5 seconds. On the website (which is broken) it says you can add an integer after autoplay: but it doesn't matter what number I add, it always takes 5 seconds to play.
And I should mention that autoPlay (with capital P) does not work for me like it's shown on their website. Only if I use autoplay it actually auto plays.
These are the settings of my owl carousel:
$("#owl-mockup").owlCarousel({
loop: true,
autoplay: 3000,
responsiveClass:true,
responsive:{
0:{
items:1,
},
600:{
items:1,
},
1000:{
items:3,
}
}
});
Why is it not listening to the number added?
Try using:
autoplay: true,
autoplayTimeout: 3000
instead:
autoplay: 3000
In owl docs says that autoplay expect a boolean value. In any case, for change the timing i'm using autoplayTimeout and it work perfect.
I had this same problem, been hacking at Owl Carousel for 48 hours now and nearly there. Regading the speed, whilst I had the Owl JS embedded in the page, I still had the external JS sheet from the initial set up that I forgot about further down the page. No matter what I did, I was stuck at 5 seconds. Once I removed it,
autoplay: true,
autoplayTimeout: 3000
the above controls worked fine.
I have a one item carousel set in this way
owl.owlCarousel({
items:1,
loop:true,
autoplay:true,
autoplayTimeout:5000,
autoplayHoverPause:true,
autoplaySpeed: 1000,
dotsSpeed: 1000
});
When I go from 1 to 2 (or between any two points lying next to each other) the transition delay 1 seconds (expected) but when I go from 1 to 4 the transition takes much more time.
I want the transition speed to be always the same (1s) regardless the distance of the points.
To clarify, when it is in dot 1 and I move to dot 2, I want the element in slide 2, delays one seconds in showing , and when going from 1 to 4 the element in the slide 4 delays one seconds in showing too.
Here a jsfiddle example
Note in the jsfiddle I put a span.test that has a 1s delay animation so when the slide move in auto play or you go from 1 to 2 just when it finished the transition, the span.test appear but when you go from 1 to 4 the span.test arrive already showing.
I will be grateful if you can help me
recently I am working on a page using this awesome plugin:
https://github.com/peachananr/onepage-scroll
However I am not familiar with JavaScript so I will be obliged if someone could explain to me few things:
I'd like to combine one-scroll-page behaviour with anchor scrolling, simple example:
function scrollContent(id) {
$('html, body').animate({ scrollTop: $('#' + id).offset().top }, 1000 );
}
as far as I know there is an embedded function called "$.fn.moveTo(page_index)"(see plugin link) but I wasn't able to use it successfully.
I'd like to turn a slider when leaving page #1 to save resources, slider launches with function:
$('#da-slider').cslider({
autoplay : true,
interval : 8000,
});
tried to simply turn off autoplay by messing with callbacks but it turned out to be bad solution:
$(".main").onepage_scroll({
sectionContainer: "section", // sectionContainer accepts any kind of selector in case you don't want to use section
easing: "ease", // Easing options accepts the CSS3 easing animation such "ease", "linear", "ease-in",
// "ease-out", "ease-in-out", or even cubic bezier value such as "cubic-bezier(0.175, 0.885, 0.420, 1.310)"
animationTime: 1000, // AnimationTime let you define how long each section takes to animate
pagination: true, // You can either show or hide the pagination. Toggle true for show, false for hide.
updateURL: true, // Toggle this true if you want the URL to be updated automatically when the user scroll to each page.
beforeMove: function(index) {}, // This option accepts a callback function. The function will be called before the page moves.
afterMove: function(#1) {
$('#da-slider').cslider({
autoplay : off,
interval : 8000,
});
}, // This option accepts a callback function. The function will be called after the page moves.
loop: true, // You can have the page loop back to the top/bottom when the user navigates at up/down on the first/last page.
keyboard: true, // You can activate the keyboard controls
responsiveFallback: 600, // You can fallback to normal page scroll by defining the width of the browser in which
// you want the responsive fallback to be triggered. For example, set this to 600 and whenever
// the browser's width is less than 600, the fallback will kick in.
direction: "horizontal" // You can now define the direction of the One Page Scroll animation. Options available are "vertical" and "horizontal". The default value is "vertical".
});
Every tip, even link to jquery tutorial will be very helpfull. Thanks in advance!
Solution found:
$("#your-div-id").on("click", function(){$(".main").moveTo(2);});
I have a drop down menu of JS in my website Please click here for website but its dropping very slow. Below is the JS code I am having. Please let me know how to make it to drop fast in Zero Second...
$(document).ready(function($){
$('#mega-menu-7').dcMegaMenu({
rowItems: '3',
speed: 'fast',
effect: 'slide'
});
});
Change speed: 'fast' to speed: 0. dcMegaMenu uses the literal speed value for the animation time, so if you set it to 0 it doesn't actually animate and will perform the transition instantly.