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.highlight.js | |
parent | 489160abd896aac7c140775207d18a3bf489c08f (diff) | |
download | jquery-ui-ab281b36d7cc10913a77f2f8da9ff7b7c011b3ee.tar.gz jquery-ui-ab281b36d7cc10913a77f2f8da9ff7b7c011b3ee.zip |
Diffstat (limited to 'ui/source/effects.highlight.js')
-rw-r--r-- | ui/source/effects.highlight.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ui/source/effects.highlight.js b/ui/source/effects.highlight.js new file mode 100644 index 000000000..8eeabe39e --- /dev/null +++ b/ui/source/effects.highlight.js @@ -0,0 +1,35 @@ +;(function($) {
+
+ $.effects.highlight = function(o) {
+
+ return this.queue(function() {
+
+ // Create element
+ var el = $(this), props = ['backgroundImage','backgroundColor','opacity'];
+
+ // Set options
+ var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
+ var color = o.options.color || "#ffff99"; // Default highlight color
+
+ // Adjust
+ $.effects.save(el, props); el.show(); // Save & Show
+ el.css({backgroundImage: 'none', backgroundColor: color}); // Shift
+
+ // Animation
+ var animation = {backgroundColor: $.data(this, "ec.storage.backgroundColor")};
+ if (mode == "hide") animation['opacity'] = 0;
+
+ // Animate
+ el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
+ if(mode == "hide") el.hide();
+ $.effects.restore(el, props);
+ if (mode == "show" && jQuery.browser.msie) this.style.removeAttribute('filter');
+ if(o.callback) o.callback.apply(this, arguments);
+ el.dequeue();
+ }});
+
+ });
+
+ };
+
+})(jQuery);
\ No newline at end of file |