PageSourceSearch

https://www.radiovilamajor.cat/wp-content/themes/xmag/js/main.js?ver=20170211

js radiovilamajor.cat collected 2026-10-02 14:17:19 UTC 2,332 bytes, 93 lines download raw bytes

1/**
2 * Mobile navigation
3 */
4 
5;(function( $, window, document, undefined ){
6	"use strict";
7	
8	$( document ).ready( function ($) {
9		
10		var $body = $('body');
11
12		$('#mobile-menu-toggle').click( function( e ) {
13			$body.toggleClass('mobile-menu-open');
14			$( 'body,html' ).scrollTop( 0 );
15			return false;
16		} );
17
18		var defaultWindowWidth = $(window).width();
19		$(window).resize(function() {
20			if ( defaultWindowWidth != $(window).width() ) {
21				$body.removeClass('mobile-menu-open');
22			}
23		});
24
25		var $mobile_nav = $('#mobile-navigation');
26
27		var $clone_main_nav = $('#main-navigation').children().clone();
28		$clone_main_nav.find( '.sub-posts' ).remove();
29		$clone_main_nav = $clone_main_nav.removeAttr('id').removeClass('main-menu').addClass('mobile-menu');
30		
31		var $clone_top_nav = $('#top-navigation').children().clone();
32		$clone_top_nav.find( '.sub-posts' ).remove();
33		$clone_top_nav = $clone_top_nav.removeAttr('id').removeClass('top-menu').addClass('mobile-menu');
34		
35		$mobile_nav.append( $clone_main_nav, $clone_top_nav );
36
37	} );
38})( jQuery, window , document );
39
40
41/**
42 * Scroll Up
43 */
44jQuery(document).ready(function(){
45	jQuery("#scroll-up").hide();
46	jQuery(function () {
47		jQuery(window).scroll(function () {
48			if (jQuery(this).scrollTop() > 800) {
49				jQuery('#scroll-up').fadeIn();
50			} else {
51				jQuery('#scroll-up').fadeOut();
52			}
53		});
54		jQuery('a#scroll-up').click(function () {
55			jQuery('body,html').animate({
56				scrollTop: 0
57			}, 600);
58			return false;
59		});
60	});
61});
62
63
64/**
65 * No-touch detection
66 */
67if (!("ontouchstart" in document.documentElement)){ 
68    document.documentElement.className += " no-touch"; 
69}
70
71
72/**
73 * Skip link focus fix
74 */
75( function() {
76	var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,
77	    is_opera  = navigator.userAgent.toLowerCase().indexOf( 'opera' )  > -1,
78	    is_ie     = navigator.userAgent.toLowerCase().indexOf( 'msie' )   > -1;
79
80	if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {
81		window.addEventListener( 'hashchange', function() {
82			var element = document.getElementById( location.hash.substring( 1 ) );
83
84			if ( element ) {
85				if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) {
86					element.tabIndex = -1;
87				}
88
89				element.focus();
90			}
91		}, false );
92	}
93})();

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.