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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:13:56+00:00 2026-05-27T11:13:56+00:00

I am animating the background image of a div using jQuery .animate(), but sometimes

  • 0

I am animating the background image of a div using jQuery .animate(), but sometimes the container is pushed below the fold and I’m afraid users will miss the animation because they haven’t scrolled down to view it by the time it’s done. Is there a way to delay the animation until the div that’s being animated is visible in the browser’s viewport? Here’s my code for whatever it’s worth:

    <div id="last-criteria">
        <div class="rating-criteria">
            <?php _e("Total Score", "swagger"); ?>
        </div>
        <div id="last-rating" class="rating-wrapper"<?php echo $rating_style; ?>>
            <?php oswc_get_rating($rating, $postType, true); ?>
            <br class="clearer" />
        </div>
        <br class="clearer" />
    </div>


<script type="text/javascript">
    jQuery.noConflict();
    jQuery(document).ready(function() {
        jQuery('#last-criteria').delay(2000).animate({
            backgroundPosition: '260 0'
        }, 2500, 'easeOutCubic');
    });
</script>
  • 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-27T11:13:56+00:00Added an answer on May 27, 2026 at 11:13 am

    I think the “in view” plugin for jQuery would help you alot.

    http://remysharp.com/2009/01/26/element-in-view-event-plugin/

    $('div').bind('inview', function (event, visible) {
        if (visible == true) {
            // element is now visible in the viewport
        } else {
            // element has gone out of viewport
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OKAY! Here's the situation. I've got a jQuery plugin that's animating a background-image in
I have a series of words animating, using css3. A background image of the
Could we move background image instead of moving div by using css3 animation? For
I m un-animating a list using this code... function unanimate_li() { $li.filter(':last') .animate({ height:
I'm using a UIImageView as a background-image and placed multiple UIButtons on it. Now
So I have a div and I added a background image via CSS. I
jQuery animation is too slow on IE. Particularly background image animation. Is there other
I have a little Problem using jQuery.animate with firefox: when i animate the height
I'm using jQuery 1.4.2, and jQuery Tools 1.2.5 to animate an accordion in my
I have near about 255 image frames for background animation, 99 frames of enemy

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.