summaryrefslogtreecommitdiff
path: root/lib/scripts/behaviour.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scripts/behaviour.js')
-rw-r--r--lib/scripts/behaviour.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js
index db9dbacc2..dd7676432 100644
--- a/lib/scripts/behaviour.js
+++ b/lib/scripts/behaviour.js
@@ -124,4 +124,22 @@ var dw_behaviour = {
};
+jQuery.fn.dw_hide = function(fn) {
+ return this.slideUp('fast', fn);
+};
+
+jQuery.fn.dw_show = function() {
+ return this.slideDown('fast');
+};
+
+jQuery.fn.dw_toggle = function(bool) {
+ return this.each(function() {
+ var $this = jQuery(this);
+ if (typeof bool === 'undefined') {
+ bool = $this.is(':hidden');
+ }
+ $this[bool ? "dw_show" : "dw_hide" ]();
+ });
+};
+
jQuery(dw_behaviour.init);