> To savely restore the state, you could do something like this (untested):
> jQuery.fn.plugin = function() {
>   var oldStack = $.merge( [], this.stack );
>   // do other stuff
>   this.stack = oldStack;
>   return this;
> };
> 
> By merging the current stack into an empty array, a copy of the current
> stack is created, which can then be used to restore the stack.

Another solution:

jQuery.fn.plugin = function() {
  var oldState = $(this);
  // do other stuff;
  return oldState;
};

This would return the same state, but a different object. If your code has a 
refernce to the jQuery object before the plugin is called, the reference would 
point to a different object then the one that is returned by the plugin.
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to