Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6950273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:04:21+00:00 2026-05-27T14:04:21+00:00

I am using animate.css and right now I have a CSS style for animated2500

  • 0

I am using animate.css and right now I have a CSS style for animated2500 which means it will take 2.5 seconds to animate. The style is:

.animated2500 {
    -webkit-animation: 2500ms ease;
    -moz-animation: 2500ms ease;
    -ms-animation: 2500ms ease;
    animation: 2500ms ease;
}

So in my HTML I would do:

<p class="animated2500 pulse">Takes 2.5 seconds to pulse</p>

There has to be an easier way to do this though, because I will want to specify how many seconds without creating a custom class for it each time.

Is there a way to use a custom data attribute like: <p data-delay="5000" class="fade">Fade in 5 econds</p> would that work?

How could I accomplish something like this?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:04:22+00:00Added an answer on May 27, 2026 at 2:04 pm

    I don’t think you can use pure CSS for this, individual styles are the way to go.

    If you really want to use a data-* attribute, since you’ve tagged your question jquery, I’ll post a jQuery-specific answer although CSS animations and data attributes are not specific to jQuery (or even JavaScript):

    jQuery(function($) {
        $(".pulse[data-delay]").each(function() {
            var value = parseInt(this.getAttribute("data-delay"), 10);
            if (!isNaN(value)) {
                value = value + "ms ease";
                this.style["-webkit-animation"] = value;
                this.style["-moz-animation"] = value;
                this.style["-ms-animation"] = value;
                this.style["animation"] = value;
            }
        });
    });
    

    That runs through the elements on DOM ready and applies the style directly. I don’t like it for several reasons (not least that new elements added to the page post-load won’t get handled), but if you really, really don’t want to create specific classes…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I'm using the following to animate the element to 150px: $(.user-review-toggle).toggle(function(){ $(this).css(display,
I am using the flip animation to animate between two views in my viewcontroller.
I'm using a CAKeyframeAnimation to animate a view along a CGPath. When the animation
I have this: var $ul = $(this).children(ul); $ul.animate({opacity: 0}, 1000); $ul.delay(1000).css(display, none) It's for
I've put together some key frame animations in CSS which animate a div from
Using JQuery animate I would like to operate with css classes, defined somewhere in
I have added text animation using javascript function: <div id=stats> <div class=textEffects> Text 1
I was using: Data.$notification .delay(1500) .animate({ right: '+=' + (Data.$notification.width() + 45) }, 700)
I have a very basic function which I am using jQuery to slide some
Im currently using 2 CSS style sheets with media queries attached for my website

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.