What is the best approach to transforming my jQuery function into CSS to ensure responsiveness?

I have created a jQuery animation with four functions named ani1(), ani2(), ani3(), and ani4(). Everything is working fine on desktop, but now I am facing the challenge of making it responsive for mobile devices. I am looking for CSS code to replicate the same animation I have created using jQuery.

Here is my HTML structure:

<img class="1st" src="img/imgpsh_fullsize.png" style="width:100%; height:100%;">

<div id="animate1" style="bottom:16.5em;left:33.5em;display:none;">
<img class=" boy" src="img/finger.png" style="" />
</div>  

<div class="2nd" style="position:absolute; bottom:0; left:25em;display:none;">
<img class="remote" src="img/remote.png">
</div>

<div class="3rd" style="position:absolute; bottom:0; left:20em;display:none;">
<img class="hand" src="img/hand1.png">
</div>

<div class="4th" style="position:absolute; bottom:0; left:5em;display:none;">
<img class="ie" src="img/ielogo.png">
</div>

And here is the corresponding jQuery code:

function ani1() {
    $("#animate1").fadeIn().animate({'display':'inline-block'}, 1000, function(){
        $('.1st').animate({'opacity': '0.9','z-index':'2'}, 1500, function(){
            $('.1st').animate({'opacity':'1','z-index':'2'});
        });
    });
    $("#animate1").fadeIn().animate({'display':'inline-block'}, 3000).fadeOut();
}

// Functions for ani2(), ani3(), and ani4() follow...

var interval1 = [ani1, ani2, ani3, ani4];
var index = 0;
$(document).ready(function(){
    window.setInterval(function(){ 
        interval1[index++ % interval1.length]();
    }, 8800);
});

While the jQuery animation works well on desktop, I now aim to translate these functions into CSS animations that run sequentially without overlapping. How can I achieve this seamless transition between the four jQuery functions in CSS?

Answer №1

One possible solution to the sequencing issue is by utilizing animation-delays. It's important to note that CSS can only animate numerical properties, meaning animating the display property will not yield the desired effect.

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

Encountered an issue with accessing the property 'path' of undefined in nodejs

Below is my server side code snippet: var fs = require('fs'), MongoClient = require('mongodb').MongoClient, db; var url = "mongodb://localhost:27017/fullwardrobedb"; MongoClient.connect(url, {native_parser: true}, function (err, connec ...

Responsive Font Sizing in React Native

Does React Native automatically adjust font size based on screen size? If I set the fontSize to 10 for a Text component, will it resize according to different phone sizes? If not, what is the best way to make fonts responsive in React Native? ...

Automatically appending textarea value in HTML tag upon form submission via JQuery

When a form is submitted through JQuery, the HTML tag automatically adds textarea value. This is my JQuery code: $('#calling').click(function() { $('#myform').submit(); }); Within my form, there is a textarea element: <textar ...

Exploring TypeScript Module Importation and WebPack Integration

Struggling with WebPack's injection of imported dependencies for a TypeScript project. The first challenge is getting TypeScript to recognize the imported module. In the header.ts file, there is a declaration of a module nested under vi.input, export ...

Struggling to resolve the "undefined index id" issue in PHP AJAX despite trying multiple approaches

While creating a click event to send the employee's ID, I am encountering an issue where even though I can see the value using console.log(), I continue to receive an index :id error. <input type="button" class="btn btn-primary" value="Appointment ...

Exploring HTML segments with Python and BeautifulSoup

As a beginner, I am exploring web scraping examples from Automate the Boring Stuff. My goal is to create a Python script that automates downloading images from PHD Comics using the following steps: Identify the image link in the HTML and download it. ...

Attempting to parse the data within the success function consistently fails

$.ajax({ type : 'GET', url : 'dialog.php', data: { champion_name:champion_name }, dataType: "text", success : function(data){ alert(data); var dataStr = $(data).find('h2').html() ...

I keep receiving unexpected security alerts in Firefox without any specific cause

After making some updates to my page, I started receiving a security warning. The data you've entered may be at risk as it is being sent over an insecure connection that could potentially be intercepted by a third party. I'm puzzled because m ...

Embedding an Iframe in Angular 2 directly from the database

Looking for assistance with iframes in Angular 2. Initially, embedding an iframe directly into a component's template functions correctly. <iframe src='http://plnkr.co/edit/zZ0BgJHvQl5CfrZZ5kzg?p=preview | safeUrl' allowtransp ...

Can the V8 JavaScript engine made by Google be used on iOS devices?

Is V8 compatible with iOS? If not, what embeddable JavaScript engine would you suggest? UPDATE: We will only be using it for internal scripting purposes, rather than in combination with HTML rendering. ...

Having issues with uploading a webcam picture using ajax. Occasionally the image only seems to be saved partially. Any suggestions on what I might be

Working on my web application involves taking customer photos and uploading them with Ajax. I base64 encode the pictures, resulting in large data sizes (around 1.4MB). The process involves Ajax calling a php script to handle the data transfer and saving it ...

Matching the scope property in AngularJS directives

I am currently working on creating a custom directive that will perform regex validation on specific input fields. The goal is for the directive to determine which regex pattern to use based on an attribute provided in the input element. Here is an exampl ...

How can you check the status of a user in a Guild using Discord JS?

Is there a way to retrieve the online status of any user in a guild where the bot is present? Although I can currently access the online status of the message author, I would like to be able to retrieve the online status of any user by using the following ...

CSS-only Tooltip: text is getting truncated

I am experimenting with adding tooltips to my forum posts. Short tooltips work fine, but longer ones are causing issues by cutting off text. Changing the position property from relative to absolute fixes this problem, but causes the text to overlap. Here ...

Error: JavaScript function call did not provide a return value

Currently, I am in the process of creating a straightforward angular2/expressJS application. Within my expressJS code, I have an HTTP GET router call that retrieves all users from MongoDB and successfully returns them: app.get('/getusers', funct ...

What is the best method for utilizing dynamically assigned keys within a JSON object?

I am currently working with Rhino and I need to find a way to utilize a variable in order to define the key of a map. Here's an example of what I'm trying to achieve: var name = "Ryan"; var relationshipType = "brother"; var relatedName = "David" ...

Nested Classes in JQuery

Looking for help with fading in text using jQuery. Despite setting everything up, it doesn't seem to be working. Can someone assist me with this issue? Here is my current code: .nav ul li { opacity: 0; padding: 0px 50px; transition: opacity 2s ease-i ...

What is the process for incorporating multiple HTML pages into an Ionic hybrid mobile application?

Struggling to combine my sign in and sign up pages into a single index.html page. I'm currently working on a project involving Hybrid mobile app development. ...

Twice the clicking actions triggered by the event

Whenever I try to trigger a function by clicking on the label text, the click event seems to be firing twice. HTML <label class="label_one"> Label One <input type="checkbox"/> </label> However, if I modify the HTML code as f ...

Is there a way to give only the left corners of a button a rounded look?

Here is the visual representation of the button: https://i.stack.imgur.com/Bjlkp.png ...