0

Hello!

I got a page which whenever a checkbox is checked I want to insert an image to the right of the check box. Can anyone help?

- realchamp.

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Airshow
0

what you could do is preload the image and set its visibility to be hidden, then on the onclick event of the checkbox, you can just set the image to be visible.

OR

you can have a div next to the checkbox, then on the onclick even just change the innerhtml of that div to display an image.

0

what you could do is preload the image and set its visibility to be hidden, then on the onclick event of the checkbox, you can just set the image to be visible.

OR

you can have a div next to the checkbox, then on the onclick even just change the innerhtml of that div to display an image.

Thanks. I was just testing and it worked perfectly :)

0

Realchamp,

Another way to do this is to use the "sprite" method.

A sprite is a specially composed background image (in eg a div), which is dynamically offset (horizontally or vertically) by javascript to show one of two or more facets

Sprites are efficient and fun and very well documented on the web.

This would be my preferred way to achieve the effect you want.

Airshow

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.