FancyBox for wordpress – using custom expression

I am big fan of the WordPress plugin Fancybox for WordPress  which using the Fancybox Jquery plugin.

one day i want to apply the group option for each gallery shortcode on the same page.

I used the the custom expression to achieve the task by going to wordpress admin => setting => Fancybox for WP => galleries => custom expression and changing the code to the following

1
2
3
4
var posts = jQuery(".gallery");
posts.each(function() {
jQuery(this).find(thumbnails).addClass("fancybox").attr("rel","fancybox"+posts.index(this)).getTitle();
});

snapshot for the setting page fancybox-customexpression