Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Link to JS Fiddle

I have a requirement like when user clicks on center circle, that should toggle outer circle and when user clicks on outer small circles that should change center circle value.

Here i am not getting how to Show/ hide part of Canvas when user clicks on center circle?

Any help on how to do this?
Posted

1 solution

<canvas%gt; is an atomic building block of HTML5 (element) and can not be partially hidden...
The only way is repaint the content of your canvas according to your need (not to paint the hidden parts)...
 
Share this answer
 
Comments
Sri Nivas.M 16-Dec-14 5:45am    
Okay. I am trying with clip Property in CSS, which is not even showing any effect on canvas element :(
Kornfeld Eliyahu Peter 16-Dec-14 6:02am    
Try this
canvas {
clip-path: polygon(...);
}
Sri Nivas.M 16-Dec-14 6:12am    
Not worked..:(
Kornfeld Eliyahu Peter 16-Dec-14 6:35am    
You better show us your code that 'not worked'...
Sri Nivas.M 16-Dec-14 6:40am    
i have added CSS like

canvas#canvasFlag {
-webkit-clip-path: circle(20px at 100px 100px);
-moz-clip-path: circle(20px at 100px 100px);
-ms-clip-path: circle(20px at 100px 100px);
clip-path: circle(20px at 100px 100px);
}

Clip path is working only in Chrome not working in IE, Safari, Firefox

For Remaining code i have already given JS fiddle link

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900