/* _________________________________________________________________________________________________ pz.jquery.extend version 0.01 extends the jquery object with a couple of functions: - wait(time, type) - toggleVisibility() - slide(width, height, time, easing) - move(x, y, time, easing, callback) _________________________________________________________________________________________________ */ jQuery.fn.extend({ wait: function(time, type) { _time = time || 1000; _type = type || "fx"; return this.queue(_type, function() { var _this = $(this); setTimeout(function() { _this.dequeue(); }, _time); }); }, toggleVisibility: function() { return this.each(function() { var _this = $(this); if (_this.is(":hidden")) _this.show(); else _this.hide(); }); }, slide: function(width, height, time, easing) { _time = time || 1000; _easing = easing || 'easeOutQuart'; return this.each(function() { var _this = $(this); if(width==null || width==undefined) width = _this.width(); if(height==null || height==undefined) height = _this.height(); _this.stop().animate({"width":width, "height":height}, _time, _easing ); }); }, move: function(x, y, time, easing, callback) { var _x = x || 0; var _y = y || 0; var _time = time || 1000; var _easing = easing || 'easeOutQuart'; var _callback = callback || null; return this.each(function(){ var _this = $(this); _this.stop().animate({"left":_x, "top":_y}, _time, _easing, _callback); }); } });