]> source.dussan.org Git - jquery-ui.git/commitdiff
Should add a visual test for the standard show/hide method to make sure we don't...
authorgnarf <gnarf@gnarf.net>
Thu, 3 Mar 2011 01:46:19 +0000 (19:46 -0600)
committergnarf <gnarf@gnarf.net>
Thu, 3 Mar 2011 01:46:19 +0000 (19:46 -0600)
tests/visual/effects.all.html
tests/visual/effects.all.js

index 6fd07fb39486c28cbf1b50bd97bb2eec1f07eb53..074ebcca6b1352d05124de4b376a81c00ae431d5 100644 (file)
                </div>
        </li>
 
+       <li>
+               <div class="effect" id="hide">
+               <p>hide/show (jQuery)</p>
+               </div>
+       </li>
+
 </ul>
 
 </body>
index 0479c47ac7c59487c18e6633934336284c6aa3cc..b11c13183a0be0bb440fd8259a6df427aae63fcd 100644 (file)
@@ -1,5 +1,6 @@
 
 $(function() {
+       var duration = 1000, wait = 500;
 
        $("div.effect")
                .hover(function() { $(this).addClass("hover"); },
@@ -13,15 +14,24 @@ $(function() {
 
                $(el).bind("click", function() {
 
-                       $(this).addClass("current").hide(n, o, 1000, function() {
+                       $(this).addClass("current").hide(n, o, duration, function() {
                                var self = this;
                                window.setTimeout(function() {
-                                       $(self).show(n, o, 1000, function() { $(this).removeClass("current"); });
-                               },500);
+                                       $(self).show(n, o, duration, function() { $(this).removeClass("current"); });
+                               }, wait);
                        });
                });
 
        };
+       
+       $("#hide").click(function() {
+               var el = $(this);
+               el.addClass("current").hide(duration, function() {
+                       setTimeout(function() {
+                               el.show(duration, function() { el.removeClass("current") });
+                       }, wait);
+               })
+       })
 
        effect("#blindHorizontally", "blind", { direction: "horizontal" });
        effect("#blindVertically", "blind", { direction: "vertical" });