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

  • Home
  • SEARCH
  • 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 8732823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:30:44+00:00 2026-06-13T09:30:44+00:00

I have certain set of predefined css classes, using which i can animate a

  • 0

I have certain set of predefined css classes, using which i can animate a div. The scenario is that i am trying to animate a div with ‘slide in effect’. Just by adding ‘slide in’ class to the div will make the div slide in. But the problem comes when do that second time. on second time , the div will already have ‘slide in’ class , so i am removing the ‘slide in’ class and i am adding the same class again to animate. But the animation doesnt happen, but when i add a 10ms delay before adding the ‘slide in’ class just after removing the ‘slide in’ class, the animation occurs.

Demos, works well only in webkit browsers

Demo one, (No time delay added, animation doesnt work second time)

Demo1 Try the slide in button two times.

Demo two, (Time delay added , animation works)

Demo2Try the slide in button two times.

I want to know , how this can be done without relying on time delay

  • 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-06-13T09:30:45+00:00Added an answer on June 13, 2026 at 9:30 am

    For demo 1 – replace your slide function by this:

    function slide(){
      $('#tg').addClass('slide in');
     var t= setTimeout(function(){$('#tg').removeClass('slide in');},600);
    }
    

    I removed the class after the animation is complete. Demo: http://jsbin.com/eyerot/12/edit

    For autoscroll:
    Replace your js by this:

    function slide(){
      interval = setInterval(function(){slide_me();},2000);
    }
    
    function slide_me(){
      $('#tg').addClass('slide in');
        t= setTimeout(function(){$('#tg').removeClass('slide in');},600);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a certain set of assertions that I give to z3 which are
I'd like an input field that I can have javascript set certain attributes for,
I have a menu list (ul/li) which I'm trying to match a certain set
I have a string which I want to split using a certain set of
I have certain initializing functions that I use to set up audit logging on
I have this function which is supposed to set a certain time format to
I have a set of changes which work perfectly against a certain linux version,
I have been trying to set the scroll of my page to a certain
I have a certain hirerchy of classes that needs the capeability to copy all
I have a certain set of data that has a very certain spacing that

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.