I'm unable to call fancybox on an element like this:
$(this).parent().parent().parent().find('.comments').fancybox();
**Is that not possible? Is it due to it being a class instead of an id?**
I have several rows of items so it's not possible to have ids for all of them.
Any advice? Here is the whole JS code (the show() here works, but fancybox() fails):
$(".action").click(function(e) {
e.preventDefault();
$(this).parent().parent().parent().find('.comments').show();
return false;
});
以上就是Can fancybox be called on a class?的详细内容,更多请关注web前端其它相关文章!