effects: modified save mthod so it now only aves css atributes stored in the actual style attribute, fixes highlight

This commit is contained in:
Paul Bakaus 2008-05-31 16:49:00 +00:00
parent c068874890
commit d32917596e
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@
$.extend($.effects, { $.extend($.effects, {
save: function(el, set) { save: function(el, set) {
for(var i=0;i<set.length;i++) { for(var i=0;i<set.length;i++) {
if(set[i] !== null) $.data(el[0], "ec.storage."+set[i], el.css(set[i])); if(set[i] !== null) $.data(el[0], "ec.storage."+set[i], el[0].style[set[i]]);
} }
}, },
restore: function(el, set) { restore: function(el, set) {

View File

@ -10,13 +10,14 @@
// Set options // Set options
var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
var color = o.options.color || "#ffff99"; // Default highlight color var color = o.options.color || "#ffff99"; // Default highlight color
var oldColor = el.css("backgroundColor");
// Adjust // Adjust
$.effects.save(el, props); el.show(); // Save & Show $.effects.save(el, props); el.show(); // Save & Show
el.css({backgroundImage: 'none', backgroundColor: color}); // Shift el.css({backgroundImage: 'none', backgroundColor: color}); // Shift
// Animation // Animation
var animation = {backgroundColor: $.data(this, "ec.storage.backgroundColor")}; var animation = {backgroundColor: oldColor };
if (mode == "hide") animation['opacity'] = 0; if (mode == "hide") animation['opacity'] = 0;
// Animate // Animate