0

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).

enter image description here

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

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

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?
I Would yes, jQuery UI also takes care of any cross browser problems with the checkboxes :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.