From d4bdd19429b82acebf37772669b796cc84e1674a Mon Sep 17 00:00:00 2001 From: gnarf Date: Wed, 4 May 2011 23:40:16 -0500 Subject: [PATCH] effects.test: adding a test for size using toggle --- tests/visual/effects.all.html | 8 +++++++- tests/visual/effects.all.js | 21 +++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/tests/visual/effects.all.html b/tests/visual/effects.all.html index 5c2c418ae..fed35de8a 100644 --- a/tests/visual/effects.all.html +++ b/tests/visual/effects.all.html @@ -147,7 +147,13 @@
  • -

    Size

    +

    Size Default Show/Hide

    +
    +
  • + +
  • +
    +

    Size Toggle

  • diff --git a/tests/visual/effects.all.js b/tests/visual/effects.all.js index 1c9c71efd..17e2c6448 100644 --- a/tests/visual/effects.all.js +++ b/tests/visual/effects.all.js @@ -28,10 +28,10 @@ $(function() { var el = $(this); el.addClass("current").hide(duration, function() { setTimeout(function() { - el.show(duration, function() { el.removeClass("current") }); + el.show(duration, function() { el.removeClass("current"); }); }, wait); - }) - }) + }); + }); effect("#blindLeft", "blind", { direction: "left" }); effect("#blindUp", "blind", { direction: "up" }); @@ -61,7 +61,16 @@ $(function() { effect("#puff", "puff", { times: 2 }); effect("#scale", "scale", {}); - effect("#size", "size", { from: { width: 300, height: 300 }}); + effect("#size", "size", {}); + $("#sizeToggle").bind("click", function() { + var opts = { to: { width: 300, height: 300 }}; + $(this).addClass('current') + .toggle("size", opts, duration) + .delay(wait) + .toggle("size", opts, duration, function() { + $(this).removeClass("current"); + }); + }); $("#shake").bind("click", function() { $(this).addClass("current").effect("shake", {}, 100, function() { $(this).removeClass("current"); }); }); @@ -83,13 +92,13 @@ $(function() { $("#removeClass").click(function() { $(this).addClass("current").removeClass(function() { window.console && console.log(arguments); - return "current" + return "current"; }, duration); }); $("#toggleClass").click(function() { $(this).toggleClass(function() { window.console && console.log(arguments); - return "current" + return "current"; }, duration); }); });