Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide a HTML5 Canvas element

I try to use the HTML5 Canvas tag, until now I managed to do what I wanted. But now I'm trying to hide in fade a Canvas element (context). The retunred error is context.fadeOut is not a function.

See my draft here: http://jsfiddle.net/t46Ze/4/

Thanks for your help.


EDIT > Here my initial wanted : http://jsfiddle.net/t46Ze/15/

EDIT > Here the Andrew proposition : http://jsfiddle.net/t46Ze/16/ (with comments)

like image 317
Jack NUMBER Avatar asked Apr 27 '26 19:04

Jack NUMBER


2 Answers

You're trying to fade out the 2D context of the canvas, not the canvas element itself. Fade out the element itself instead.

like image 81
James Avatar answered Apr 29 '26 11:04

James


Do $(canvas).fadeOut instead of context.fadeOut

like image 39
Anders Marzi Tornblad Avatar answered Apr 29 '26 11:04

Anders Marzi Tornblad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!