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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:52:37+00:00 2026-05-18T04:52:37+00:00

hello i have a series of divs created in a for loop like so:

  • 0

hello i have a series of divs created in a for loop like so:

var myDiv ='#bannerHolder'
        var fib_str = '1, 2, 3, 5, 8, 13, 21, 1, 2, 3, 5, 8, 13, 21, 1, 2, 3, 5, 8, 13, 21, 1, 2, 3, 5, 8, 13'
        var widths_str = '33px, 31px, 35px, 9px, 16px, 50px, 33px, 24px, 40px, 20px, 63px, 30px, 10px, 29px, 11px, 12px, 51px, 31px, 35px, 11px, 14px, 50px, 30px, 25px, 38px, 20px, 35px'
        var pos_str = '0px, 44px, 105px, 144px, 153px, 203px, 236px, 269px, 280px, 354px, 374px, 437px, 447px, 457px, 506px, 517px, 529px, 604px, 646px, 687px, 698px, 712px, 762px, 787px, 823px, 895px, 915px'
        var color_str = '#D5E1D7, #18D4C9,#BF51C3,#1E82C9, #EDEDED, #E1C981, #C9A94F, #BDBCAA, #5DB522, #EB2F34, #823133, #004BD8, #A6A0A0, #DS9F36, #FFDB00, #69944F, #18D4C9, #BF51C3, #1E82C9, #6B949A, #FFDB00, #819E64, #BDBCAA, #54BA43, #EB2F34, #823133'
        var width = widths_str.split(",");
        var pos = pos_str.split(",");
        var color = color_str.split(",");
        var fib = fib_str.split(",");
        console.log(width);
        console.log(pos);
        console.log(color);
        var counter = width.length
        var stopper = false;
for(i=0;i<counter;i++){
                var html = '<div id ="stripe'+i+'"/>'   
                $(myDiv).append(html)
                $('#stripe'+i).css({  'top': 0,  'left': pos[i],'position': 'absolute', 'float': 'left', 'background-color' : color[i]})
                $('#stripe'+i).attr({ 'min-width' : width[i], 'min-height' : '100px'  })
                $('#stripe'+i).width(width[i])
                $('#stripe'+i).height('100px')


            };

what i want is to have each div created fade out completly then fade back in again and for this process to keep repeating for ever. if i try to use .animate() and call a function for the Complete: property i get too many recursions and the page breaks, how can i do this

  • 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-18T04:52:37+00:00Added an answer on May 18, 2026 at 4:52 am

    The problem is recursively calling the fade*() routines from inside each other, you need to setup the sequence as something that can be called repeatedly in a non-recursive fashion.

    This is quite a neat method:

    Demo here: http://jsfiddle.net/ZZGhn/

    $('.block').bind('fade-cycle', function() {
        $(this).fadeOut('fast', function() {
            $(this).fadeIn('fast', function() {
                $(this).trigger('fade-cycle');
            });
        });
    });
    
    // This next block of code just sets all the triggers off at random times
    // The point is to start them using .trigger('fade-cycle');
    // All can be started simultaneously with $('.block').trigger('fade-cycle');
    
    $('.block').each(function(index, elem) {
        setTimeout(function() {
            $(elem).trigger('fade-cycle');
        }, index * 250);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have like this 2 tables class User public int UserId{get;set;} { ....
Hello I have a datatable that I would like to filter with a single
Hello I have a 1000 data series with 1500 points in each. They form
Hello I have an api response in xml format with a series of items
Hello I have a loop which renders elements within a partial view. The elements
Hello i have 2 arrays and and i want to put them in a
Hello I have next function, what always return null as result, but service calling
hello i have this question i was trying to find a way to call
hello I have my code that connects to my ftp server $conn_id = ftp_connect($ftp_server);
Hello I have a UISegmentedControl with two segments. The selected segment is modified programmatically

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.