David Duymelinck schrieb:
> i know somewhere in the list there is a solution but i can't find it at 
> the moment.
> 
> I want to pass the animate hash as an option so i don't need to go into 
> the plugin to change the animation effects.
> 
> $('#test').plugin({anihide: {opacity: 'hide'}, anishow: {opacity: 
> 'show'}, anitime: 3000});
> 
> $.fn.test = function(options){
>     var anihide = options.anihide;
>     var anishow = options.anishow;
>     var anitime = options.anitime;
>     $(img).siblings("img:visible").animate(anihide, 
> anitime).end().animate(anishow, anitime);
> }
> 
> The last line is from the actual plugin, the other code is pseudo code. 
> But i think you can understand the point i'm trying to make.
> When i alert anihide the first time i get the opacity value but the 
> second time i get true as value.
> 


I ran into the same problem with the tabs plugin. The original object is 
modified for the animation, so as a workaround I copy the object each 
time before passing it to animate:


$.fn.test = function(options){
     var anihide = $.extend({}, options.anihide); // copy object
     var anishow = $.extend({}, options.anishow);
     var anitime = options.anitime;
     $(img).siblings("img:visible").animate(anihide, 
anitime).end().animate(anishow, anitime);
;

Jörn has already filed a ticket for this:
http://jquery.com/dev/bugs/bug/237/

-- Klaus

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to