Skip to content
Permalink
Browse files

Should add a visual test for the standard show/hide method to make su…

…re we don't break it by overriding it
  • Loading branch information
gnarf committed Mar 3, 2011
1 parent 2ad1cf3 commit 0b18671d2819bbd9b0ff9f020a5b5b9372cace3d
Showing with 19 additions and 3 deletions.
  1. +6 −0 tests/visual/effects.all.html
  2. +13 −3 tests/visual/effects.all.js
@@ -174,6 +174,12 @@
</div>
</li>

<li>
<div class="effect" id="hide">
<p>hide/show (jQuery)</p>
</div>
</li>

</ul>

</body>
@@ -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" });

0 comments on commit 0b18671

Please sign in to comment.
You can’t perform that action at this time.