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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:29:48+00:00 2026-06-01T11:29:48+00:00

I have a responsive layout and I’ve created a fading panels animated element with

  • 0

I have a responsive layout and I’ve created a fading panels animated element with jQuery. I set the jQuery function to only activate if the user is above a certain screen size. However, if I scale the window down, the function still runs.

Here’s what I’d like to achieve:

  1. When the user scrolls bellow a browser width of 1440px, stop that fading panels animation.
  2. Once the animation is stopped, I want to reset the area to display the 1st panel.
  3. If the user scrolls back up above that screen size, start the animation again.

Here is my code, thanks in advance for your time:

// Get the viewport size!
var viewport = $(document).width();

if (viewport >= 1140) {

var InfiniteRotator = 
{
    init: function() 
    {
        // hard set height of container
        $('#circles').height('286.717px');

        // initial fade-in time
        var initialInterval = 3000;

        // interval between items
        var itemInterval = 5000;

        // cross-fade time
        var fadeTime = 2000;

        // count number of items
        var numberOfItem = $('.rotating-item').length;

        // set current item
        var currentItem = 0;

        // create loop
        var infiniteLoop = setInterval(function() { 

            // initial fade out
            $('.rotating-item').eq(currentItem).fadeOut(fadeTime);

            // set counter
            if (currentItem == numberOfItem -1) {
                currentItem = 0;
            } else {
                currentItem++;
            }

            // next item fade in
            $('.rotating-item').eq(currentItem).fadeIn(fadeTime);

        }, itemInterval);
    }
}

// go Go GO!
InfiniteRotator.init();
}

Please note: I used this great tutorial to create the fading panels: http://trendmedia.com/news/infinite-rotating-images-using-jquery-javascript/

  • 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-01T11:29:49+00:00Added an answer on June 1, 2026 at 11:29 am
    window.onresize = function() {
        clearInterval(infiniteLoop)
    }
    

    Note that you must still be in your init function in order to get the infiniteLoop variable.

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

Sidebar

Related Questions

I have created a responsive layout which you can find here: http://pixelcakecreative.com/cimlife/responsive/ The left
I have a 3 column layout, and am trying to make it more responsive
I have this element in my layout XML: <FrameLayout android:id=@+id/FrameLayout01 android:layout_width=320sp android:layout_height=380sp android:layout_gravity=center android:background=#99CC33>
I'm wondering if is possible to have a responsive layout without using CSS3. Are
I have created an app with multiple tabs, each with its own layout. I
I have designed a responsive layout that you can see here: http://pixelcakecreative.com/cimlife/responsive/ When viewed
I am designing a responsive layout and have positioned a grungy png overlay on
I have an existing image map in a responsive html layout. Images scale according
I have a scrolling element on my page (with the jScrollPane jQuery plugin). What
I am trying to build a responsive email template but have run into some

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.