PageSourceSearch

https://www.trl.co.uk/scripts/main.js?v=639265118101284549

js trl.co.uk collected 2026-10-02 03:23:49 UTC 2,301 bytes, 63 lines download raw bytes

1jQuery(document).ready(function ($) {
2	//move nav element position according to window width
3	moveNavigation();
4	$(window).on('resize', function () {
5		(!window.requestAnimationFrame) ? setTimeout(moveNavigation, 300) : window.requestAnimationFrame(moveNavigation);
6	});
7
8	//mobile version - open/close navigation
9	//$('.navbar-toggler').on('click', function (event) {
10	$('body').on('click', '.navbar-toggler', function (event) {
11		event.stopImmediatePropagation();
12		event.preventDefault();
13		$(this).toggleClass('show');
14
15		if ($('header').hasClass('nav-is-visible')) $('.moves-out').removeClass('moves-out');
16
17		$('header').toggleClass('nav-is-visible');
18		$('.cd-main-nav').toggleClass('nav-is-visible').toggle();
19		$('.cd-main-content').toggleClass('nav-is-visible');
20	});
21
22	//mobile version - go back to main navigation
23	//$('.go-back').on('click', function (event) {
24	$('body').on('click', '.go-back', function (event) {
25		event.preventDefault();
26		$('.cd-main-nav').removeClass('moves-out');
27		$('.cd-main-nav > li').removeClass('sub');
28	});
29
30	//open sub-navigation
31	//$('.cd-subnav-trigger').on('click', function (event) {
32	$('body').on('click', '.cd-subnav-trigger', function (event) {
33		event.preventDefault();
34		$('.cd-main-nav').toggleClass('moves-out');
35		$(this).parent('li').toggleClass('sub');
36	});
37
38	function moveNavigation() {
39		var navigation = $('.cd-main-nav-wrapper');
40		var screenSize = checkWindowWidth();
41		if (screenSize) {
42			//desktop screen - insert navigation inside header element
43			navigation.detach();
44			navigation.insertBefore('.navbar-toggler');
45		} else {
46			//mobile screen - insert navigation after .cd-main-content element
47			navigation.detach();
48			navigation.insertAfter('.cd-main-content');
49		}
50	}
51
52	function checkWindowWidth() {
53		var mq = window.getComputedStyle(document.querySelector('header'), '::before').getPropertyValue('content').replace(/"/g, '').replace(/'/g, "");
54		return (mq === 'mobile') ? true : false;
55	}
56
57	if ($(window).width() < 769) {
58		$('#newsCarousel').removeAttr('data-ride').removeClass('carousel');
59		$('#expertsCarousel').removeAttr('data-ride').removeClass('carousel');
60		$('#projectsCarousel').removeAttr('data-ride').removeClass('carousel');
61		$('#popularlinksCarousel').removeAttr('data-ride').removeClass('carousel');
62	}
63});

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.