Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change icon colors based off of two methods of functionality.

Posted on 2014-03-16
4
Medium Priority
?
176 Views
Last Modified: 2014-03-18
I'm trying to change the icon color to say "red" for two methods of functionality.

1. I have main heading delete options which should change the main heading color trash can to red as well as the subset trash cans and they should toggle on/off when clicking the main heading trash can.

2. The subset trash can icons should also toggle color but only on a individual basis. I know how to do this using jquery in other ways but I'm looking for a solution based off of the current code that's driving the functionality I already have. Just seeing if there's a condensed way of doing it than the if/else statement i would do.

Also, don't pay attention to the checkboxes. They should have no interaction on the page itself. I will have those hidden and they are only used in the actual delete process which I have working already.

http://jsfiddle.net/x3s42/

Thx!
0
Comment
Question by:brihol44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 15

Assisted Solution

by:Insoftservice
Insoftservice earned 200 total points
ID: 39933588
Just replace

$('.pull-right a').click(function() {
     var $checkbox = $(this).next("input")
    $checkbox.prop("checked",!$checkbox.prop('checked'))

 $(this).closest(".heading").next('div').find("input").prop("checked",$checkbox.prop('checked'));
          $(this).closest(".heading").next('div').find('div').toggleClass("checked", this.checked);

});

css

.checked {
    background-color: #ff0000;
}
Try and check whether it suits your criteria
0
 

Author Comment

by:brihol44
ID: 39935763
Sorry but it doesn't seem to work.
0
 
LVL 44

Accepted Solution

by:
Chris Stanyon earned 1400 total points
ID: 39936835
Have a look at this. It seems to work fine:

http://jsfiddle.net/ChrisStanyon/x3s42/3/
0
 

Author Closing Comment

by:brihol44
ID: 39938682
Works awesome! Thx!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question