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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:55:24+00:00 2026-06-09T08:55:24+00:00

My aim is to acheive something like this http://corkboard.me/GlJTVkD34A , when the button that

  • 0

My aim is to acheive something like this http://corkboard.me/GlJTVkD34A, when the button that changes the background is clicked both the background of the note and the image in the button are changed.
At the momemt i’ve been able to get the exact same thing, the onclick event on the note, the div that pops up on top but i tried to change the background by putting all the classes in an array like below and it hasn’t worked.
I still have no idea how to make the button image change simultaneously with the note’s background.

//nbg is the button above that is to be cliked to change the backgound
var nbg = $('#nbg');
var count = 0;
nbg.each(function() {
    var thisnotice = $(this);
    thisnotice.click(function() {
    var notice_classes =['changeablenbg_yellow','changeablenbg_green','changeablenbg_pink','changeablenbg_purple','changeablenbg_blue'];
        if(notice_classes[count] === "changeablenbg_blue") {
        var count = 0
        }
    //#box is the note div itself
    $('#box').toggleClass(notice_classes[count]);
    count++;
    }); 
}); 

I also tried to loop the array using a for loop but to no avail..
Can someone who knows please guide me on doing this. I’m sorry if i haven’t explained it well enough, please ask anything you don’t understand.

  • 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-09T08:55:25+00:00Added an answer on June 9, 2026 at 8:55 am

    You’ve kinda got some weird things going on in your code, but the biggest is that you’re toggling which is like a light switch. Press it, and it turns on and it stays on. Press it again and it turns off. Here you press and it turns on and switches to the next color, and then you press and it turns on the second getting in the way of the first.

    Then you’ve got the dual count problem. You’re stepping through each color for each NBG but only changing box. Resetting the local count but not the bigger one.

    My best advice, step through each line of code as if the computer were running it, and think what does this specific line do. Does it do what I think it does?

    Is that helpful?

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

Sidebar

Related Questions

My aim is to create a map function like this map = function ()
This is my website: http://www.stustu.co.uk .. I want to create an app that can
AIM: I would like to tail the last line of the file.txt and input
AIM: I would like to set the below function to call every 5 seconds.
I am planning to write something to take advantages of the many devices that
I have created an application that read messages with voice. I would like to
I just found some sql query build like this in my project: return (new
I got many qtips in a form with lets like this : $('.selector').qtip({ content:
Aim to Acheive : I want to execute my application from msbuild as it
I have a hindi script file like this: 3. भारत का इतिहास काफी समृद्ध

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.