Time for action – defining the transitions

The final function will perform the actual transitions:

$.tranzify.runTransition = function(config) { var transOverlay = $("#" + config.containerID), transEls = transOverlay.children(), len = transEls.length - 1; switch(config.transitionType) { case "venetian": transEls.each(function(i) { transEls.eq(i).animate({ width: 0 }, "slow", function() { if (i === len) { transOverlay.remove(); $(config.selector).find("a").css("display", "block"); } }); }); break; case "strip": var counter = 0; function strip() { transEls.eq(counter).animate({ height: 0 }, 150, function() { if (counter === len) { transOverlay.remove(); $(config.selector).find("a").css("display", "block"); } else { counter++; strip(); } }); } strip(); ...

Get jQuery 1.4 Animation Techniques Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.