Beautiful Mike...that's exactly what I was wanting to know. Thanks a
lot!
On Sep 1, 11:20 am, "Michael Geary" <[EMAIL PROTECTED]> wrote:
> > > > Is there a way to pass arguments from one anonymous function, (in
> > > > either Toggle, or Hover) to the second?
> > > Closures are your friend:
>
> >
> > > Is there a way to pass arguments from one anonymous function, (in
> > > either Toggle, or Hover) to the second?
> > Closures are your friend:
> >
> > $('a.display').each(function() {
> > var $this = $(this), size = $this.attr('href'), toggle = $('.' +
size);
> > $this.toggle(func
Thanks for the confirm Richard...and I assume that all 3 of those
would be var'd because they're on the same line?
On Sep 1, 10:32 am, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> On 9/1/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hang on...now that I look at it, I think I understan
On 9/1/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
>
> Hang on...now that I look at it, I think I understand #4. Is this
> line:
>
> var $this = $(this), size = $this.attr('href'), toggle = $('.' +
> size);
>
> the same as these lines:
> var $this = $(this)
> var size = $this.attr('href')
> var
Hang on...now that I look at it, I think I understand #4. Is this
line:
var $this = $(this), size = $this.attr('href'), toggle = $('.' +
size);
the same as these lines:
var $this = $(this)
var size = $this.attr('href')
var toggle = $('.' + size);
?
On Sep 1, 9:41 am, Andy Matthews <[EMAIL PROT
Klaus...
A few questions.
1) I'm assuming from your reply that there's no way to do this with
plain ole hover/toggle then?
2) What is a closure?
3) Is there any performance hit when doing .each (then toggle) versus
just doing .toggle?
4) Can you explain this line please?
var $this = $(thi
Andy Matthews wrote:
Is there a way to pass arguments from one anonymous function, (in
either Toggle, or Hover) to the second? Ideally I'd like to be able to
pass in whatever variables I choose, but I'd settle for being able to
pass in $(this), the item that triggered the event.
Here's the code
Try this:
.toggle(
function() {
myFunction(this, parameters...);
}
)
And you should define myFunction somewhere else.
On 1 сент, 14:28, Andy Matthews <[EMAIL PROTECTED]> wrote:
> Is there a way to pass arguments from one anonymous function, (in
> either Toggle, or Hover) to the second? Ideally
8 matches
Mail list logo