SUBIR Query(document).ready(function() { jQuery('body').delegate('.gg_gallery_wrap div.gg_img:not(.gg_coll_img, .gg_linked_img)', 'click', function(e) { e.preventDefault(); if( jQuery(e.target).parent().parent().hasClass('ggom_socials')) {return false;} var gallery_id = jQuery(this).parents('.gg_gallery_wrap').attr('id'); var clicked_url = jQuery(this).attr('gg-url'); var api_img = jQuery.makeArray(); var api_tit = jQuery.makeArray(); var api_descr = jQuery.makeArray(); jQuery('#'+gallery_id+' .gg_img').each(function(index, element) { api_img.push( jQuery(this).attr('gg-url') ); api_tit.push( jQuery(this).attr('gg-title') ); api_descr.push( jQuery(this).attr('gg-descr') ); if(clicked_url == jQuery(this).attr('gg-url')) { gg_img_index = index; } }); gg_init_prettyphoto(api_img, api_tit, api_descr, gg_img_index); }); // slider lightbox init gg_slider_lightbox = function(data, gg_img_index) { var api_img = jQuery.makeArray(); var api_tit = jQuery.makeArray(); var api_descr = jQuery.makeArray(); jQuery.each(data, function(i, v) { api_img.push( v.big ); api_tit.push( v.title ); api_descr.push( v.description ); }); gg_init_prettyphoto(api_img, api_tit, api_descr, gg_img_index); } // throw lightbox gg_init_prettyphoto = function(api_img, api_tit, api_descr, gg_img_index) { jQuery.fn.prettyPhoto({ opacity: 0, autoplay_slideshow: false, animation_speed: 0, slideshow: 0, allow_expand: false, deeplinking: false, horizontal_padding: 17, ie6_fallback: false ,social_tools: '' }); jQuery.prettyPhoto.open(api_img, api_tit, api_descr); jQuery.prettyPhoto.changePage(gg_img_index); } });