]> source.dussan.org Git - jquery-ui.git/commitdiff
effects.test: adding a test for size using toggle 204/head
authorgnarf <gnarf@gnarf.net>
Thu, 5 May 2011 04:40:16 +0000 (23:40 -0500)
committergnarf <gnarf@gnarf.net>
Thu, 5 May 2011 04:41:42 +0000 (23:41 -0500)
tests/visual/effects.all.html
tests/visual/effects.all.js

index 5c2c418ae043504dd9c921cb6f769b7b4d842ec4..fed35de8ad34718093a0dd4be876159b70f78ec2 100644 (file)
 
        <li>
                <div class="effect" id="size">
-               <p>Size</p>
+               <p>Size Default Show/Hide</p>
+               </div>
+       </li>
+
+       <li>
+               <div class="effect" id="sizeToggle">
+               <p>Size Toggle</p>
                </div>
        </li>
 
index 1c9c71efdbc6a318ff3aa1343c7fff60703a93d4..17e2c6448f46200457d8897be15fd77a969d2d92 100644 (file)
@@ -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);
        });
 });