Skip to content

Commit

Permalink
- effects!
Browse files Browse the repository at this point in the history
git-svn-id: https://semicomplete.googlecode.com/svn/pimp@208 66067f73-fe4c-0410-82e9-b9c6d0c95a22
  • Loading branch information
jordansissel committed Dec 21, 2005
1 parent 9305e46 commit 4f49c55
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions static/effects.js
@@ -0,0 +1,39 @@



Effect = {
'Fade': function (obj, time, func) {
if (!obj.style.opacity)
obj.style.opacity = 1;

var endfunc = function() {
debug("FadeObj: " + obj);
obj.style.display = "none";
if (func)
func();
};

var a = new Accelimation(obj.style, "opacity", 0, time, 1, "");
a.onend = endfunc;
a.start();
},

'Appear': function (obj, time, func) {
if (!obj.style.opacity)
obj.style.opacity = 0;

if (obj.style.display == "none")
obj.style.display = "block";

var endfunc = function() {
debug("AppearObj: " + obj);
if (func)
func();
};

var a = new Accelimation(obj.style, "opacity", 1, time, 1, "");
a.onend = endfunc;
a.start();
}
}

0 comments on commit 4f49c55

Please sign in to comment.