Adjust the speed of various CSS3 transitions on a container and its elements

Looking to incorporate Slidejs into my website? Check out the library.

I want to set different transition speeds for elements on my page. Here's how my Html structure looks like:

<div id="slides" class="sliders_1">
    <div style="background:url(/images/slider/slide1.jpg) no-repeat scroll center center; background-size:100% auto;">
        <div class="slider-title">
            <h2 class="title">Title</h2>
        </div>
        <div class="slider-subtitle">
            <h3 class="subtitle">Subtitle.</h3>
        </div>
    </div>
    <div style="background:url(/images/slider/slide1.jpg) no-repeat scroll center center; background-size:100% auto;">
        <div class="slider-title">
            <h2 class="title">Title</h2>
        </div>
        <div class="slider-subtitle">
            <h3 class="subtitle">Subtitle.</h3>
        </div>
    </div>
</div>

For instance, I want the background transition to take 500ms, while h2 transitions at 600ms and h3 at 300ms.

Hopefully that all makes sense :)

Update #1 Here is my javascript :

$('.sliders_1').slidesjs({
    width: 940,
    height: 588
});

Just need this snippet to enable the library.

Update #2 To clarify, I want the div with the background-image to slide first. Can I have h2 and h3 transition at different speeds during the initial transition?

Update #3 Check out the jsfiddle ! Works on Firefox but not on Safari, Chrome, and others... The slide speeds between the background, h2, and h3 are different, which is what I'm aiming for.

Would love for it to slide from right to left!

Answer №1

transitionDuration (number)-By default, the duration is set to 350 milliseconds.

This sets the speed of the transition animation in milliseconds.

$(function(){
      $("#slides").slides({
        transitionDuration: 350
      });
    });

scrollDuration (number)-The default scroll duration is 350 milliseconds.

This determines the speed of the scrolling animation in milliseconds.

$(function(){
      $("#slides").slides({
        scrollDuration: 350
      });
    });

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for enhancing the presentation of JSON information

I recently ventured into the world of JSON and JS, managing to create a JSON file to showcase data using .onclick event. While I have successfully generated and displayed the JSON data on screen, my next goal is to present it in a table format for better c ...

Paste the URL into your clipboard without relying on JavaScript

Is there a way to implement a copy to clipboard function for email templates without relying on JavaScript? ...

Jquery ajax request unsuccessful due to missing error message

An issue arises with the ajax request below as it fails to display an error message: $.ajax({ type: "POST", url: loginUrl, data: JSON.stringify({login : u, password : p}), contentType: "application/json; charset=utf-8", success: functi ...

Verify whether all of the iframes have finished loading

I am facing an issue with running a function when multiple iframes on the page are loaded using jQuery. The function works fine when there is only one iframe, but as soon as there are more than one, it stops working. Below is the code I am currently using: ...

What can cause a string variable to malfunction in JSON?

Here is the code I am currently working with: $(document).ready(function() { var adress = []; var locations = ' ['; $('.office p').each(function(el) { adress[el] = $(this).text(); locations = locations + '{address:& ...

Jquery Autocomplete has the ability to store and recall previous user selections

When the region is selected, autocomplete addresses should be displayed. Each time the region changes, the Jquery autocomplete function is called. While I am able to get the correct autocomplete addresses for the current region, I also receive address list ...

Animating shifting of an overflowing div using jQuery

Struggling to articulate this, so here is a little jsfiddle demo: http://jsfiddle.net/UwEe2/ The concept I am aiming for is very similar to the one in the demo, however, I require the image to be perfectly centered. In other words, I need the center of t ...

How can CSS be leveraged to generate a fluid and adaptable grid layout for icons?

Please note that using a script is not an option for me My goal is to include a set of 12 100X100 icons at the bottom of emails sent to customers. These icons should be displayed with 100% width and evenly spaced, like this: X X X X X X X X X X X X If t ...

Obtain the input elements and attach a click event to them

I have a form utilizing Bootstrap with three elements. When the button is clicked, another line with three elements is dynamically added. <div class="row align-items-center mb-2 mt-2 ms-1 "> <div class="col-5 ps-1 pe-1"> ...

including a close button when in use and excluding it when not in use

Seeking assistance with removing the "close" icon if it is not active. Here is the code I currently have $("#mason2 li div").click(function() { $(this).parent().hide().appendTo("#mason2").fadeIn(200); $(this).append('<p class="close"& ...

Full-width sub menu within the menu

I'm trying to make a sub menu appear below my main menu that is the same width as the main menu, which has a fixed width. I want the sub menu to adjust its width based on the number of links it contains. Is this even possible? Here's the code I h ...

Learn the simple technique for transferring text to the clipboard using the data-title attribute

Hey there, I need some help with the following code snippet: <h3 class="project discord" data-title="test1234"><i class='bx bx-fw bx-tada-hover bxl-discord-alt'></i>Discord</h3> I want to be able to c ...

Javascript Image Slider - Issues and Adjustments

I have a question that consists of two parts: On my website, I am using the Slicebox image slider from http://tympanus.net/Development/Slicebox/index.html, but I need to figure out how to make it play automatically. Unfortunately, the 3D effects of Slice ...

How to use jQuery toggle function to toggle a specific div without affecting others with the same class

I have a situation where each list item contains a toggle and a content class. Currently, when I click on the toggle, all content items are displayed at once. How can I use jQuery to ensure that only one content item is shown at a time? <script> $(d ...

Encountering issues with the fancy box feature on Internet Explorer

Hey, I'm having an issue with my fancy box and jQuery menu bar on my website. Everything is working fine in Chrome, but it's not functioning properly in IE. I tried adding the following code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric ...

Simple solution to resetting class in an element upon clicking another element

Is there a way to reset the glyphicon of one column back to its original state when another column is clicked while sorting a table using bootstrap glyphicons? $('.tablePointer').click(function() { $(this).find('i').each(func ...

Oops, it seems that some essential parameters are missing for the [Route: city] [URI: daftar/city/{id}

When attempting to send data to the controller using ajax, I encountered an error Required parameters are missing for `[Route: city] [URI: daftar / city / {id}]. Below is the ajax code being used $(".province").on("change",function(){ var id = th ...

How can I align two input bars next to each other using html and css?

How can I align two input bars side by side using html and css for a form layout? Something similar to this design: side by side bars ...

The jQuery mousedown() function seems to be malfunctioning and unable to trigger the drag event

I am attempting to initiate a drag event using jQuery. You can access the fiddle by clicking here http://jsfiddle.net/sgsvenkatesh/hepbob75/5/ I tried using the following code to initiate the drag event, but it doesn't seem to be working: $(documen ...

Authenticate users in PHP using code

Can PHP authorization be passed through code? I've seen authorization in a jQuery ajax request as well. Is it possible to pass PHP authorization with ajax? After receiving a page result from an ajax request, if I add the following code to the top of ...