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 8907791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:00:28+00:00 2026-06-15T03:00:28+00:00

My delay function is not working in my jquery rotate function. I am not

  • 0

My delay function is not working in my jquery rotate function. I am not sure why.

Basically, my code will make my div turn an angle and it will stop at a certain angle. This works at the moment. However i added a delay so it it will work after 3 or 4 seconds.

However its not doing it.

$(window).load(function() {
    var $elie = $("#super");
    rotate(1);

    function rotate(degree) {
        $elie.css({
            '-webkit-transform': 'rotate(' + degree + 'deg)',
            '-moz-transform': 'rotate(' + degree + 'deg)',
            '-o-transform': 'rotate(' + degree + 'deg)',
            '-ms-transform': 'rotate(' + degree + 'deg)',
            'transform': 'rotate(' + degree + 'deg)'
        });
        console.log(degree);
        if (degree < 55) {
            timer = setTimeout(function() {
                rotate(++degree)
            }, 10)
            delay: 4000;
        }
    }
});​
  • 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-15T03:00:30+00:00Added an answer on June 15, 2026 at 3:00 am

    If you want to delay the rotation just make a ‘setTimeout’ around the delay function:

    $(window).load(function() {
        var $elie = $("#super");
        setTimeout(function() {
            rotate(1);
        }, 4000)
    
        function rotate(degree) {
            $elie.css({
                '-webkit-transform': 'rotate(' + degree + 'deg)',
                '-moz-transform': 'rotate(' + degree + 'deg)',
                '-o-transform': 'rotate(' + degree + 'deg)',
                '-ms-transform': 'rotate(' + degree + 'deg)',
                'transform': 'rotate(' + degree + 'deg)'
            });
            console.log(degree);
            if (degree < 55) {
                timer = setTimeout(function() {
                    rotate(++degree)
                }, 10)
            }
        };
    });​
    

    (also as mentioned removed the dalay: 4000, which don’t has the effect you want!)

    Fiddler example: http://jsfiddle.net/49VEe/

    edit2:

    You can use HTML5 transition to get the rotation effect instead of your recursive function (sample without delay:

    $(window).load(function() {
        var $elie = $("#super");
            rotate(55);
    
        function rotate(degree) {
            $elie.css({
                '-webkit-transform': 'rotate(' + degree + 'deg)',
                '-moz-transform': 'rotate(' + degree + 'deg)',
                '-o-transform': 'rotate(' + degree + 'deg)',
                '-ms-transform': 'rotate(' + degree + 'deg)',
                'transform': 'rotate(' + degree + 'deg)',
                '-webkit-transition': 'all 1s ease-in-out',
                '-moz-transition': 'all 1s ease-in-out',
                '-o-transition': 'all 1s ease-in-out',
                transition: 'all 1s ease-in-out'
            });
        };
    });​
    

    Fiddler: http://jsfiddle.net/mZzjP/

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

Sidebar

Related Questions

I can't make the delay function of jQuery works with append function. What is
Code: $(#telecomGrayscale, this).stop().animate({ top: '467px' }, { duration: 400 }).delay(800).queue(function() { $(#boxcaptionTelecom, this).stop().animate({ top:
i am using http://malsup.com/jquery/cycle/ with jquery my code is <script> $(document).ready(function(){ $(div.hide1).fadeTo(slow, 0.13); $(div.hide1).fadeTo(slow,
how a can get this, in jQuery: call some function with working code after
I need to put a one second delay in this jQuery function so that
How do I use the JQuery delay in conjunction with my own defined function,
This is my code currently: $(function() { $('#header_left').click(function(){ $('#header_left_info').fadeOut('fast'); $('#header_left').fadeOut('fast'); $('#header_left_back').delay(250).fadeIn('fast'); }); }); (the
I am using jQuery autocomplete which is working fine with existing element but not
I have a jQuery code, that is working as I expect it to work
I am using jquery UI combo box and its not working here is my

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.