1. Owen
  2. General Talk
  3. Thursday, 12 August 2010
  4.  Subscribe via email
Hi Daniel,

Today I'm trying to improve on the look of the voting system.
I created new thumbs up/thumbs down that each comes in grey/green grey/red.
In CSS I defined that the thumbs up/down shown are both grey, and on hover with the mouse they turn green/red.
So now this works and it looks good and more responsive to the visitor.

Now, you can guess what I'm missing... I want that on click they would stay green/red and not back to grey
(at least while the user is still on the same page).

I thought one of the following might have helped by putting it in CSS after the :hover one:

#comment div.voting_yes:active {background: url(../images/thumbup_green.png) no-repeat;}
or-
#comment div.voting_yes:focus {background: url(../images/thumbup_green.png) no-repeat;}
or-
#comment div.voting_yes:visited {background: url(../images/thumbup_green.png) no-repeat;}

But I understand this doesn't suppose to work (maybe because there's no link really).

So do you know how I could achieve this?
Is it only through some javascript? Perhaps it is OnClick?

Saw this in JOSC_post.php:
public function voting_cell($mode, $num, $id) {
return "<li><div id='$mode$id' class='voting_$mode' onclick='JOSC_voting($id,\"$mode\";)'><span>$num</span></div></li>"; }

I'm not really sure what to do with the OnClick or something else in order to display the green thumbup image also after someone had clicked the thumbup.

Any ideas?

Thanks!
Responses (6)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

Changes to Submission Form?
Are you able to make changes to the Hotspot submission form? There are several f...
0 Replies
Posted on Friday, 26 April 2024
  • New
  • Question regarding custom fields
    How do I access custom fields after I have created them?...
    0 Replies
    Posted on Wednesday, 24 April 2024
  • New
    • #custom fields
    Google no index für bestimmte Seiten/Details
    Hallo ich habe eine kleine Frage: wo kann ich einstellen, dass Google die Seite...
    0 Replies
    Posted on Wednesday, 24 April 2024
  • New
  • Language parameter in the link to the comment
    Hello. 1) I have a multilingual website (3 languages). If someone added a comme...
    1 Replies
    Posted on Saturday, 06 April 2024
    categories icon in header
    Hi! I saw this in the promo, but I can't find how to set it up. https://compo...
    0 Replies
    Posted on Monday, 22 April 2024
  • New
    • #style
    • #Categories