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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:36:27+00:00 2026-06-17T22:36:27+00:00

how can i manage the array to restart from 0 (in function get_hover_color) when

  • 0

how can i manage the array to restart from 0 (in function get_hover_color) when there are too many links and color array is too short?
thanks for helping!

till.

<div class="line">
<div><h2 class="color_link">DRUCKVORSTUFE</h2></div>
<div><h2 class="color_link">SCAN</h2></div>
<div><h2 class="color_link">RETUSCHEN</h2></div>
<div><h2 class="color_link">ANDRUCK</h2></div>
<div><h2 class="color_link">PDF</h2></div>
<div><h2 class="color_link">CTP</h2></div>
<div><h2 class="color_link">STACCATO</h2></div>
.............
.............
.............
........and so on........

</div>

function get_hover_color(i){

        hover_color_array = ['54cacd','e84d3a','ff3384','a0388d','231599','0d958a','629B39','33811E','F04E00','F00200','D9008F','58dbb4','093C8B','AECB27','E5B208','74204f','C26A21','DB2C17','cccf78','166C64','9A1E6E','7EADC2','00A1CE'];

return hover_color_array[i];

     }



$('.color_link').each(function(i){
            $(this).hover(
             function(){
               var $this = $( this );
               $this.data( 'prehovercolor', $this.css( 'color' ) ).css( {'color' : '#' + get_hover_color(i), 'cursor' : 'pointer' });
             },function(){
               var $this = $( this );
               $this.css( 'color', $this.data( 'prehovercolor') );
             });
        });
  • 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-17T22:36:28+00:00Added an answer on June 17, 2026 at 10:36 pm

    Do this:

    hover_color_array[i % hover_color_array.length]
    

    That should give you a range which will fall within the array at all times since it takes the remainder, which can only range from 0 to hover_color_array.length-1

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

Sidebar

Related Questions

I would like to know if there is an existent framework which can manage
how can i manage communication with the database in node.js? is there any module
I'm trying to create a class that can manage bidimensional array. I used the
I understand that spring can manage your sessions for you, if configured like so:
i want know how i can manage multiple twitter account on iOS in my
I can't manage to figure out why I get an error for the following
How can i manage user permission? i need a fast method to manage users
I'm trying to set image for my UIBarButtonItem and I can't manage to do
I have a ruby hash which looks like {10.1.1.6=>nick, 127.0.0.1=>nick1} But I can't manage
I know that you can use static libraries to manage dependencies for iOS apps.

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.