aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorgnarf <gnarf@gnarf.net>2011-03-02 19:46:19 -0600
committergnarf <gnarf@gnarf.net>2011-03-02 19:46:19 -0600
commit0b18671d2819bbd9b0ff9f020a5b5b9372cace3d (patch)
tree67192db002d975021acad1a2caa256a0542e760d /tests
parent2ad1cf331988e9a301dcd7474783eb58fcbc3c6d (diff)
downloadjquery-ui-0b18671d2819bbd9b0ff9f020a5b5b9372cace3d.tar.gz
jquery-ui-0b18671d2819bbd9b0ff9f020a5b5b9372cace3d.zip
Should add a visual test for the standard show/hide method to make sure we don't break it by overriding it
Diffstat (limited to 'tests')
-rw-r--r--tests/visual/effects.all.html6
-rw-r--r--tests/visual/effects.all.js16
2 files changed, 19 insertions, 3 deletions
diff --git a/tests/visual/effects.all.html b/tests/visual/effects.all.html
index 6fd07fb39..074ebcca6 100644
--- a/tests/visual/effects.all.html
+++ b/tests/visual/effects.all.html
@@ -174,6 +174,12 @@
</div>
</li>
+ <li>
+ <div class="effect" id="hide">
+ <p>hide/show (jQuery)</p>
+ </div>
+ </li>
+
</ul>
</body>
diff --git a/tests/visual/effects.all.js b/tests/visual/effects.all.js
index 0479c47ac..b11c13183 100644
--- a/tests/visual/effects.all.js
+++ b/tests/visual/effects.all.js
@@ -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" });