jquery-ui/tests/visual/effects.all.js

65 lines
1.8 KiB
JavaScript
Raw Normal View History

2008-09-20 17:42:04 +00:00
$(document).ready(function() {
2008-09-20 17:42:04 +00:00
$("div.effect")
.hover(function() {
$(this).addClass("hover");
}, function() {
$(this).removeClass("hover");
})
;
2008-09-20 17:42:04 +00:00
var effect = function(el, n, o) {
2008-09-20 17:42:04 +00:00
$.extend(o, {
easing: "easeOutQuint"
});
2008-09-20 17:42:04 +00:00
$(el).bind("click", function() {
2008-09-20 17:42:04 +00:00
$(this).addClass("current").hide(n, o, 1000, function() {
var self = this;
window.setTimeout(function() {
$(self).show(n, o, 1000, function() { $(this).removeClass("current"); });
},500);
});
});
2008-09-20 17:42:04 +00:00
};
2008-09-20 17:42:04 +00:00
effect("#blindHorizontally", "blind", { direction: "horizontal" });
effect("#blindVertically", "blind", { direction: "vertical" });
2008-09-20 17:42:04 +00:00
effect("#bounce3times", "bounce", { times: 3 });
2008-09-20 17:42:04 +00:00
effect("#clipHorizontally", "clip", { direction: "horizontal" });
effect("#clipVertically", "clip", { direction: "vertical" });
2008-09-20 17:42:04 +00:00
effect("#dropDown", "drop", { direction: "down" });
effect("#dropUp", "drop", { direction: "up" });
effect("#dropLeft", "drop", { direction: "left" });
effect("#dropRight", "drop", { direction: "right" });
2008-09-20 17:42:04 +00:00
effect("#explode9", "explode", { });
effect("#explode36", "explode", { pieces: 36 });
2008-09-20 17:42:04 +00:00
effect("#fold", "fold", { size: 50 });
2008-09-20 17:42:04 +00:00
effect("#highlight", "highlight", { });
2008-09-20 17:42:04 +00:00
effect("#pulsate", "pulsate", { times: 2 });
2008-09-20 17:42:04 +00:00
effect("#puff", "puff", { times: 2 });
effect("#scale", "scale", { });
2008-09-20 17:42:04 +00:00
$("#shake").bind("click", function() { $(this).addClass("current").effect("shake", {}, 100, function() { $(this).removeClass("current"); }); });
2008-09-20 17:42:04 +00:00
effect("#slideDown", "slide", { direction: "down" });
effect("#slideUp", "slide", { direction: "up" });
effect("#slideLeft", "slide", { direction: "left" });
effect("#slideRight", "slide", { direction: "right" });
2008-09-20 17:42:04 +00:00
$("#transfer").bind("click", function() { $(this).addClass("current").effect("transfer", { to: "div:eq(0)" }, 1000, function() { $(this).removeClass("current"); }); });
2008-06-09 12:19:59 +00:00
});