Reputation: 11
I am trying to get a function to work for each .download_now
element.
I have used the two below with no luck, any idea why?
$(".download_now").each.tooltip({ effect: 'slide'});
$(".download_now").each(tooltip({ effect: 'slide'}));
Neither answer will work, I'm trying it on the following: http://flowplayer.org/tools/demos/tooltip/any-html.html
Upvotes: 0
Views: 208
Reputation: 817208
You don't need .each()
. Just do:
$(".download_now").tooltip({ effect: 'slide'});
(like the first page of the showcase shows)
Upvotes: 0
Reputation: 37029
You need to pass a function into the each method. Typically, an anonymous function is used like so:
$('.download_now').each(function() {
...
});
Each DOM object can be referenced using this
within the function.
Upvotes: 0
Reputation: 449813
You need to wrap the tooltip call inside a function.
each()
will then call the function for each iteration, passing the current element as this
.
Like so:
$(".download_now").each(function(){
$(this).tooltip({ effect: 'slide'})
});
Upvotes: 0