diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-05-23 09:26:18 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-05-23 09:26:18 +0000 |
commit | ab281b36d7cc10913a77f2f8da9ff7b7c011b3ee (patch) | |
tree | e75c648d2ee6a4fb467a2f1a2d092e1544a938a5 /ui/source/effects.blind.js | |
parent | 489160abd896aac7c140775207d18a3bf489c08f (diff) | |
download | jquery-ui-ab281b36d7cc10913a77f2f8da9ff7b7c011b3ee.tar.gz jquery-ui-ab281b36d7cc10913a77f2f8da9ff7b7c011b3ee.zip |
Diffstat (limited to 'ui/source/effects.blind.js')
-rw-r--r-- | ui/source/effects.blind.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ui/source/effects.blind.js b/ui/source/effects.blind.js new file mode 100644 index 000000000..1681ae286 --- /dev/null +++ b/ui/source/effects.blind.js @@ -0,0 +1,37 @@ +;(function($) { + + $.effects.blind = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'vertical') ? 'height' : 'width'; + var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width(); + if(mode == 'show') wrapper.css(ref, 0); // Shift + + // Animation + var animation = {}; + animation[ref] = mode == 'show' ? distance : 0; + + // Animate + wrapper.animate(animation, o.duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }); + + }); + + }; + +})(jQuery);
\ No newline at end of file |