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

Trying to resize the image in the comments
Hey everyone, Basically I am trying to make the images in the comments smalle...
9 Replies
Posted on Wednesday, 12 August 2009
J5 compatibility for Hotspots
Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
2 Replies
Posted on Monday, 24 February 2025
  • #Hotspots
  • #hotspots Joomla 5
error message when adding/cofiguring email address
When configuring the email plugin that send a email message to admin when a new ...
0 Replies
Posted on Friday, 09 May 2025
CMigrator: Path from Drupal 6 to J5?
(Category s/b CMigrator, but didn't see it on the list) I'm interested in usi...
0 Replies
Posted on Monday, 28 April 2025
Dowload all Hotspots entries
Hi there, I'm looking for a way to dowload all the Hotspots entries. I've got t...
0 Replies
Posted on Sunday, 06 April 2025
  • #kml
  • #download