On 10/10/07, Olivier Percebois-Garve <[EMAIL PROTECTED]> wrote:
> I want to store something in the first function (over) and use it in the
> second (out).
>
> -Olivier

Hi Olivier, I think this would work:

jQuery.fn.simpleTooltip = function(o){
  var sharedVar;
  $(this).hover(
    function(){
      sharedVar = 'this string is used in the "out" function';
    },
    function(){
      alert(sharedVar);
  });
}

I think all anonymous functions declared within a plugin have access
to vars declared further up the scope chain (or something to that
effect).

Joel Birch.

Reply via email to