HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ns3133907 6.8.0-84-generic #84-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 5 22:36:38 UTC 2025 x86_64
User: cssnetorguk (1024)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //home/crescentelectronics.co.uk/public_html/js/gallery-masonry/gallery-masonry.js
$(function () {
	var $container = $('#gallery-imgs');
	var masonry_selector = '.gallery-item:not([class*="invisible-box"])';
	var prettyPhoto_selector = '.gallery-item([class*="invisible-box"])';
	var gallery_items = $(".gallery-item");
	var sortby = 'all';
	
	$container.imagesLoaded(function(){
		$container.masonry({
			itemSelector : masonry_selector,
			columnWidth : 225,
			isAnimated: true
		});
		//gallery_items.find.attr('rel', sortby);
	});
	
	function reloadPrettyPhoto(sortby_now) {
		$(".pp_pic_holder").remove();
		$(".pp_overlay").remove();
		$(".ppt").remove();
		// edit it with your initialization
		if (sortby_now == 'all') {
			$("a[rel^='prettyPhoto']").prettyPhoto({
				social_tools: false,
			});
		} else {
			$('.gallery-item[data-tags*="' + sortby_now + '"]'+" a[rel^='prettyPhoto']").prettyPhoto({
				social_tools: false,
			});
		}
		
	}
	
	$("#gallery-sort-menu li").click(function(e) {
		e.preventDefault();
		sortby = $(this).attr('data-id');

		$("#gallery-sort-menu li").removeClass('active');
		$(this).addClass('active');
		gallery_items.removeClass('invisible-box');
		$container.masonry( 'reload' );

		if( sortby == 'all' ) {
			gallery_items.removeClass('invisible-box');
			$container.masonry( 'reload' );
			
			// Activate prettyPhoto category
			reloadPrettyPhoto(sortby);
		} else {
			gallery_items.addClass('invisible-box');			
			
			var spec_items = $('[data-tags*="' + sortby + '"]');
			spec_items.removeClass('invisible-box');			
			//spec_items.find('a').attr('rel', sortby);

			$container.masonry( 'reload' );
			
			// Activate prettyPhoto category
			reloadPrettyPhoto(sortby);
		}
	});
	
	// Activate prettyPhoto category
	reloadPrettyPhoto(sortby);	

});