PageSourceSearch

https://www.gwup.org/wp-content/themes/enfold/js/avia-snippet-footer-effects.js?ver=8.1

js gwup.org collected 2026-10-01 11:32:41 UTC 1,723 bytes, 97 lines download raw bytes

1/**
2 * Support for footer behaviour
3 * ============================
4 *
5 *	- Curtain effect
6 *
7 * @since 4.8.6.3
8 */
9(function($)
10{
11	"use strict";
12
13	var win = null,
14		body = null,
15		placeholder = null,
16		footer = null,
17		max_height = null;
18
19	$( function()
20	{
21		win = $(window);
22		body = $('body');
23
24		if( body.hasClass( 'av-curtain-footer' ) )
25		{
26			aviaFooterCurtain();
27			return;
28		}
29
30		return;
31	});
32
33
34	function aviaFooterCurtain()
35	{
36		footer = body.find( '.av-curtain-footer-container' );
37
38		//	remove classes
39		if( footer.length == 0 )
40		{
41			body.removeClass( 'av-curtain-footer av-curtain-activated av-curtain-numeric av-curtain-screen' );
42			return;
43		}
44
45		placeholder = $( '<div id="av-curtain-footer-placeholder"></div>' );
46		footer.before( placeholder );
47
48		if( body.hasClass( 'av-curtain-numeric' ) )
49		{
50			max_height = footer.data( 'footer_max_height' );
51			if( 'undefined' == typeof max_height )
52			{
53				max_height = 70;
54			}
55			else
56			{
57				max_height = parseInt( max_height, 10 );
58				if( isNaN( max_height ) )
59				{
60					max_height = 70;
61				}
62			}
63		}
64
65		aviaCurtainEffects();
66
67		win.on( 'debouncedresize', aviaCurtainEffects );
68	}
69
70	function aviaCurtainEffects()
71	{
72		var height = Math.floor( footer.outerHeight() ),
73			viewportHeight = win.innerHeight();
74
75		//	screen width based
76		if( null == max_height )
77		{
78			placeholder.css( { height: height + 'px' } );
79		}
80		else
81		{
82			var limit = Math.floor( viewportHeight * ( max_height / 100.0 ) );
83			if( height > limit )
84			{
85				body.removeClass( 'av-curtain-activated' );
86				placeholder.css( { height: '' } );
87			}
88			else
89			{
90				body.addClass( 'av-curtain-activated' );
91				placeholder.css( { height: height + 'px' } );
92			}
93		}
94
95	}
96
97})(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.