Yeah!!! you could use JavaScript for this. I don''t know if there is a
gem,
but with JS you can do that. See more about JS event over checkboxes. Now,
load it dynamic checkboxes? If you answer is yes, you can use css for help
you. Greetings.
I did this:
<html>
<head>
<script>
var currentItemWithBackGround = '''';
function setColor(obj) {
var partial_id;
if(currentItemWithBackGround != '''')
{
document.getElementById(''div_'' +
currentItemWithBackGround).style.backgroundColor = ''white'';
}
partial_id = obj.id.split(''_'')[1];
currentItemWithBackGround = partial_id;
// Put your color here ...
document.getElementById(''div_'' +
partial_id).style.backgroundColor ''gray'';
}
</script>
<style>
.checkbox {
background-color: gray;
}
</style>
</head>
<body>
<div id=''div_One''>
<input id=''chk_One'' type="checkbox"
onMouseOver=''setColor(this);'' /> One
</div>
<div id=''div_Two''>
<input id=''chk_Two'' type="checkbox"
onMouseOver=''setColor(this);''/> Two
</div>
<div id=''div_Three''>
<input id=''chk_Three'' type="checkbox"
onMouseOver=''setColor(this);''/> Three
</div>
</body>
</html>
2009/6/17 Mikael Björkegren
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
>
> Hi!
>
> Anyone who knows any good way to change a checkbox color, like iCal
> checkboxes. If there is a gem or somthing like that.
>
> Thanks.
>
> Attachments:
> http://www.ruby-forum.com/attachment/3829/Bild_1.png
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---