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

_MATUKIO_NO_EVENTS appears in the frontend if no e
Hello, there ist still the problem, that on the frontpage appears COM_MATUKIO...
0 Replies
Posted on Sunday, 12 May 2024
  • New
  • Complete Uninstall to Work in J4??
    We have recently updated a site from Joomlav3 to v4 (4.4.2). Now when we go to m...
    7 Replies
    Posted on Tuesday, 30 April 2024
    Info about CMigrator for Joomla
    Hi i need to import a few thousand articles from a site made in wordprres to a ...
    0 Replies
    Posted on Tuesday, 07 May 2024
  • New
    • #CMigator
    Error on android phone
    Why its working good on Computer and if i try it with smartphones the map dosent...
    0 Replies
    Posted on Tuesday, 07 May 2024
  • New
  • Bug with front-end submission and table not having
    Hi, i think i found a problem. When trying to edit a hotspot from front-end ...
    3 Replies
    Posted on Wednesday, 15 March 2023