jQuery 1.3 new live() method, can't make it work with Fancybox.

136 views
Skip to first unread message

qlinail

unread,
Apr 16, 2009, 6:27:09 AM4/16/09
to fancybox
hi guys,

jQuery 1.3 new live() method, can't make it work

code :

$(".aimg").live("click", function(){ $(this).fancybox() } );


help me . thx.

Janis

unread,
Apr 16, 2009, 6:37:47 AM4/16/09
to fancybox
Nothing unusual. In your example fancybox will bind click event to
that element.

Janis

qlinail

unread,
Apr 16, 2009, 8:13:06 AM4/16/09
to fancybox
How can I use live() ? thx.

Janis

unread,
Apr 16, 2009, 9:55:34 AM4/16/09
to fancybox
If you read carefully http://docs.jquery.com/Events/live you will
realize that .live() function is used to bind handler on event.
So, I guess you are looking for http://docs.jquery.com/Plugins/livequery
and use it like this -
$(".aimg").livequery(function(){
$(this).fancybox();
});


Janis

qlinail

unread,
Apr 16, 2009, 10:01:00 AM4/16/09
to fancybox
Thank you very much!!!

On Apr 16, 9:55 pm, Janis <janis.skarne...@gmail.com> wrote:
> If you read carefullyhttp://docs.jquery.com/Events/liveyou will
> realize that .live() function is used to bind handler on event.
> So, I guess you are looking forhttp://docs.jquery.com/Plugins/livequery
Reply all
Reply to author
Forward
0 new messages