It is obviously very simple question but I have never done such thing before. My designer want some thing like this for check boxes (it is on left side. Checked ones are grey and other white).
2 Answers
One idea is to use a span with background-image (empty box), hide a related checkbox, and assign a clickhandler to the the span (onclick: change checked attribute of the related hidden checkbox, change background image of the span accordingly).
Here is an example of that
Comments
For this sort of thing i use jQuery UI. An example is here : http://jqueryui.com/demos/button/#checkbox
and some example code:
<script>
$(function() {
$( "#check" ).button();
$( "#format" ).buttonset();
});
</script>
2 Comments
Imran Subhani
I am not using "jQuery UI" in my site, for this small piece of visual effect do you think I should include jQuery UI Core and UI Widget to my javascripts?
Undefined
I Would yes, jQuery UI also takes care of any cross browser problems with the checkboxes :)
