PageSourceSearch

https://otaviopinto.com/wp-content/themes/rowling/assets/js/global.js?ver=2.1.1

js otaviopinto.com collected 2026-10-02 11:41:41 UTC 2,391 bytes, 100 lines download raw bytes

1jQuery(document).ready(function($) {
2
3
4	// Toggle mobile menu
5	$(".nav-toggle").on("click", function(){	
6		$(this).toggleClass("active");
7		$(".mobile-menu").slideToggle();
8		if ($(".search-toggle").hasClass("active")) {
9			$(".search-toggle").removeClass("active");
10			$(".search-container").slideToggle();
11		}
12		return false;
13	});
14	
15	
16	// Toggle search container
17	$(".search-toggle").on("click", function(){	
18		$(this).toggleClass("active");
19		$(".search-container").slideToggle();
20		if ($(".nav-toggle").hasClass("active")) {
21			$(".nav-toggle").removeClass("active");
22			$(".mobile-menu").slideToggle();
23		}
24		return false;
25	});
26
27	// Add focus class to menus
28	$( '.dropdown-menu a' ).on( 'blur focus', function( e ) {
29		$( this ).parents( 'li.menu-item-has-children' ).toggleClass( 'focus' );
30	} );
31	
32	
33	// Hide mobile menu/search container at resize
34	$(window).resize(function() {
35	
36		if ($(window).width() >= 850) {
37			$(".nav-toggle").removeClass("active");
38			$('.mobile-menu').hide();
39		}
40		
41		if ($(window).width() <= 850) {
42			$(".search-toggle").removeClass("active");
43			$('.search-container').hide();
44		}
45	
46	});
47	
48	
49	// Dropdown menus on touch devices
50	$( '.primary-menu li:has(ul)' ).doubleTapToGo();
51	$( '.secondary-menu li:has(ul)' ).doubleTapToGo();
52	
53	
54	// Load Flexslider
55    $(".flexslider").flexslider({
56        animation: "slide",
57        controlNav: false,
58        prevText: "",
59        nextText: "",
60        smoothHeight: true   
61    });
62	
63	
64	// smooth scroll to the top	
65	jQuery(document).ready(function($){
66	    $('.to-the-top').click(function(){
67	        $("html, body").animate({ scrollTop: 0 }, 500);
68	        return false;
69	    });
70	});
71	
72	
73	// resize videos after container
74	var vidSelector = ".post iframe, .post object, .post video";	
75	var resizeVideo = function(sSel) {
76		$( sSel ).each(function() {
77			var $video = $(this),
78				$container = $video.parent(),
79				iTargetWidth = $container.width();
80
81			if ( !$video.attr("data-origwidth") ) {
82				$video.attr("data-origwidth", $video.attr("width"));
83				$video.attr("data-origheight", $video.attr("height"));
84			}
85
86			var ratio = iTargetWidth / $video.attr("data-origwidth");
87
88			$video.css("width", iTargetWidth + "px");
89			$video.css("height", ( $video.attr("data-origheight") * ratio ) + "px");
90		});
91	};
92
93	resizeVideo(vidSelector);
94
95	$(window).resize(function() {
96		resizeVideo(vidSelector);
97	});
98	
99
100});

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.