javascript - How to hide and show images drawn on canvas on event? -


i drawn images on canvas passing x , y co-ordinates json. want hide images if checked checkbox button , want show if un-checked checkbox button.

so appreciate if hints.

using jquery can hide show image div following way can this.

$(document).ready(function () {     $("#map_canvas").hide();     $("#map_checkbox").click(function () {         if ($("#map_checkbox").is(":checked")) {             $("#map_canvas").show();         } else if ($("#map_checkbox").not(":checked")) {             $("#map_canvas").hide();         }     }) });   

jsfiddle demo

note: in above code #map_canvas canvas div attribute id=map_canvas. , #map_checkbox checkbox attribute id=#map_checkbox.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -