PageSourceSearch

https://stone-paper.com/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/icongrid/icongrid.js

js stone-paper.com collected 2026-10-06 20:06:08 UTC 2,249 bytes, 87 lines download raw bytes

1(function($)
2{ 
3	"use strict";
4
5    $(window).on('load', function (e) {
6		$('.avia-icongrid-flipbox').avia_sc_icongrid();
7    });
8	
9	// -------------------------------------------------------------------------------------------
10	// Icongrid shortcode javascript
11	// -------------------------------------------------------------------------------------------
12	
13	$.fn.avia_sc_icongrid = function(options)
14	{
15		$('.avia-icongrid-flipbox li').on('touchend', function() {
16					var current = $(this),
17						container = current.closest('.avia-icongrid-flipbox');
18						
19					if( current.hasClass('avia-hover') )
20					{
21						container.find('li').removeClass( 'avia-hover' );
22					}
23					else
24					{
25						container.find('li').removeClass( 'avia-hover' );
26						current.addClass( 'avia-hover' );
27					}
28				});	
29	
30		return this.each(function()
31		{
32			var container = $(this),
33                icongrid_id = '#' + $(this).attr('id'),
34                methods;
35
36            methods =
37			{
38				buildIconGrid: function () {
39
40                    this.setMinHeight($(icongrid_id + ' li article'));
41                    this.createFlipBackground($(icongrid_id + ' li'));
42
43
44				},
45
46				setMinHeight: function (els) {
47
48					if (els.length < 2) return;
49
50					var elsHeights = new Array();
51					els.css('min-height', '0').each(function (i) {
52						var current = $(this);
53						var currentHeight = current.outerHeight(true);
54						elsHeights.push(currentHeight);
55					});
56
57					var largest = Math.max.apply(null, elsHeights);
58					els.css('min-height', largest);
59
60
61				},
62
63				createFlipBackground: function(els) {
64
65				//	if ( ! container.hasClass('avia-icongrid-flipbox') ) return;
66
67					els.each(function(index,element){
68						var back = $(this).find('.avia-icongrid-content');
69						if (back.length > 0) {
70							if ( $(this).find('.avia-icongrid-flipback').length <= 0 ) {
71                                var flipback = back.clone().addClass('avia-icongrid-flipback').removeClass('avia-icongrid-content');
72                                back.after(flipback);
73							}
74						}
75					});
76
77				}
78			};
79            methods.buildIconGrid();
80            $(window).on( 'resize', function() {
81                methods.buildIconGrid();
82            });
83		});
84	};
85	
86	
87}(jQuery));

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.