Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ![]() Interested in joining? Click here. If you are already a member of ZBCode, feel free to login right here: |
| [ZB] Jquery help - applying CSS to reportCP link | |
|---|---|
| Tweet Topic Started: Apr 7 2009, 06:07 AM (212 Views) | |
| gladstone | Apr 7 2009, 06:07 AM Post #1 |
![]()
|
So I have this: $("#menu_rcp a:contains('1')").css({ "background-color":"#BF0000" }); Whenever there is a report, the background of the 'menu_rcp a' class turns a shade of red. What I don't know how to do is to write the code so that with any number of reports, one onwards, the background colour changes. Thanks ^^ |
![]() |
|
| Reid | Apr 8 2009, 09:09 AM Post #2 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Ah, good old regular expressions rear their ugly head again. I'm not exactly a jQuery master - I know enough to make my code shorter but I don't work with it that often - so this is what I would do
I feel that should work, but I make no guarantees. I just woke up after all.. the times I normally poke my head around coding forums.. a habit I should change, I think. ![]() Also, it dawned on me while I looked at the code that there is only one ID of menu_rcp so I shouldn't be using .each() - I'm not sure of an alternative, however, as again I only dabble lightly in jQuery. Does anyone have one? Lol. |
| The Resource Board | |
![]() |
|
| gladstone | Apr 9 2009, 12:22 PM Post #3 |
![]()
|
doesn't appear to workies
|
![]() |
|
| rockon1824 | Apr 9 2009, 02:56 PM Post #4 |
|
I never know what to put for my member title. =(
![]()
|
Give this a shot:
|
| |
![]() |
|
| gladstone | Apr 9 2009, 05:40 PM Post #5 |
![]()
|
Thanks dude, that works ^^ |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Code University · Next Topic » |

















7:48 PM Jul 10