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, {
save: function(el, set) {
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) {

View File

@ -10,13 +10,14 @@
// Set options
var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
var color = o.options.color || "#ffff99"; // Default highlight color
var oldColor = el.css("backgroundColor");
// 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")};
var animation = {backgroundColor: oldColor };
if (mode == "hide") animation['opacity'] = 0;
// Animate