Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Raphael.js - can I use .show/.hide with fade effect?

Is there a way to make element fade in or fade out using Raphael.js? My code is something like:

var elem = paper.circle(10, 10, 10)
elem.hide();

Is there an attribute to .hide() to make fade effect, something like:

var elem = paper.circle(10, 10, 10)
elem.hide({'duration':5000});
like image 537
Demeter Avatar asked May 07 '13 07:05

Demeter


1 Answers

You can animate opacity for fade effect

var elem = paper.circle(10, 10, 10);
elem.animate({ opacity : 0 }, 1000, function () { this.hide() });

To fadeIn,

elem.show().animate({ opacity : 1 }, 1000);

like image 182
Jashwant Avatar answered Sep 28 '22 04:09

Jashwant