PageSourceSearch

https://iamkashishsingh.com/js/sorting.js

js iamkashishsingh.com collected 2026-10-02 17:01:29 UTC 3,968 bytes, 103 lines download raw bytes

1/* SORTING */ 
2jQuery(window).load(function(){
3	
4jQuery(function(){
5  var $container = $('.portfolio_block');
6  
7  $('.gallery_block').isotope();
8  
9   $container.isotope({
10	itemSelector : '.element'
11  });
12    
13  var $optionSets = $('#options .optionset'),
14	  $optionLinks = $optionSets.find('a');
15
16  $optionLinks.click(function(){
17	var $this = $(this);
18	// don't proceed if already selected
19	if ( $this.parent('li').hasClass('selected') ) {
20	  return false;
21	}
22	var $optionSet = $this.parents('.optionset');
23	$optionSet.find('.selected').removeClass('selected');
24	$optionSet.find('.fltr_before').removeClass('fltr_before');
25	$optionSet.find('.fltr_after').removeClass('fltr_after');
26	$this.parent('li').addClass('selected');
27	$this.parent('li').next('li').addClass('fltr_after');
28	$this.parent('li').prev('li').addClass('fltr_before');
29
30	// make option object dynamically, i.e. { filter: '.my-filter-class' }
31	var options = {},
32		key = $optionSet.attr('data-option-key'),
33		value = $this.attr('data-option-value');
34	// parse 'false' as false boolean
35	value = value === 'false' ? false : value;
36	options[ key ] = value;
37	if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {
38	  // changes in layout modes need extra logic
39	  changeLayoutMode( $this, options )
40	} else {
41	  // otherwise, apply new options
42	  $container.isotope(options);	  
43	}	
44	return false;	
45  });
46	$('.masonry').find('img').load(function(){
47		$container.isotope('reLayout');
48	}); 
49			
50});
51
52jQuery.fn.portfolio_addon = function(addon_options) {
53	//Set Variables
54	var addon_el = jQuery(this),
55		addon_base = this,
56		img_count = addon_options.items.length,
57		img_per_load = addon_options.load_count,
58		$newEls = '',
59		loaded_object = '',
60		$container = jQuery('.image-grid');
61	
62	jQuery('.btn_load_more').click(function(){
63		$newEls = '';
64		loaded_object = '';									   
65		loaded_images = $container.find('.added').size();
66		if ((img_count - loaded_images) > img_per_load) {
67			now_load = img_per_load;
68		} else {
69			now_load = img_count - loaded_images;
70		}
71		
72		if ((loaded_images + now_load) == img_count) jQuery(this).fadeOut();
73
74		if (loaded_images < 1) {
75			i_start = 1;
76		} else {
77			i_start = loaded_images+1;
78		}
79
80		if (now_load > 0) {
81			if (addon_options.type == 0) {
82				/*//1 Column Service Type
83				for (i = i_start-1; i < i_start+now_load-1; i++) {
84					loaded_object = loaded_object + '<div data-category="'+ addon_options.items[i].category +'" class="'+ addon_options.items[i].category +' element row-fluid added"><div class="filter_img span6"><div class="wrapped_img"><a href="'+ addon_options.items[i].post_zoom +'" class="prettyPhoto" rel="prettyPhoto[portfolio1]"><img src="'+ addon_options.items[i].src +'" alt="" width="570" height="340"></a></div></div><div class="portfolio_dscr span6"><div class="bg_title"><h4><a href="'+ addon_options.items[i].url +'">'+ addon_options.items[i].title +'</a></h4></div>'+ addon_options.items[i].description +'</div></div>';
85				}*/
86			} else {
87				//2-4 Columns Service Type
88				for (i = i_start-1; i < i_start+now_load-1; i++) {
89					loaded_object = loaded_object + '<div data-category="'+ addon_options.items[i].category +'" class="'+ addon_options.items[i].category +' element added">                                                    	<div class="filter_img"><div class="hover_img"><img src="'+ addon_options.items[i].src +'" alt="" /><a href="'+ addon_options.items[i].zoom_src +'" class="zoom prettyPhoto" rel="prettyPhoto[service1]">Zoom</a></div><div class="portfolio_descr"><div class="portfolio_title"><h4><a href="'+ addon_options.items[i].url +'">'+ addon_options.items[i].title +'</a></h4></div><div class="portfolio_text">'+ addon_options.items[i].description +'</div></div></div></div>';
90
91				}
92			}
93			$newEls = jQuery(loaded_object);
94			$container.isotope('insert', $newEls, function() {
95				$container.isotope('reLayout');
96				
97				jQuery('.prettyPhoto').prettyPhoto();									
98			});			
99		}
100	});
101}
102
103});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.