1//Randomises children of element with class of .shuffled 2jQuery(document).ready(function($) { 3 $('.shuffled').each(function(){ 4 var cards = $(this).children(); // if you only want a specific element type or class you could use $(this).find('.card'); 5 for(var i = 0; i < cards.length; i++){ 6 var target = Math.floor(Math.random() * cards.length -1) + 1; 7 var target2 = Math.floor(Math.random() * cards.length -1) +1; 8 cards.eq(target).before(cards.eq(target2)); 9 } 10 }); 11 12// Jumbotron Touch Swipe 13 $(".carousel").carousel({ 14 interval: false, 15 pause: true 16 }); 17 18 $( ".carousel .carousel-inner" ).swipe( { 19 swipeLeft: function ( event, direction, distance, duration, fingerCount ) { 20 this.parent( ).carousel( 'next' ); 21 }, 22 swipeRight: function ( ) { 23 this.parent( ).carousel( 'prev' ); 24 }, 25 threshold: 0, 26 tap: function(event, target) { 27 window.location = $(this).find('.carousel-item.active a.carousel-control').attr('href'); 28 }, 29 excludedElements:"label, button, input, select, textarea, .noSwipe, .action" 30 } ); 31 32 $('.carousel .carousel-inner').on('dragstart', 'a', function () { 33 return false; 34 }); 35}); 36document.addEventListener('DOMContentLoaded', function() { 37 // CLOSE BUTTON handler 38 document.querySelectorAll('.mega-close-dsk').forEach(function(closeBtn) { 39 closeBtn.addEventListener('click', function(event) { 40 const menuItem = closeBtn.closest('.mega-menu-item-has-children'); 41 if (menuItem) { 42 const submenu = menuItem.querySelector('.mega-sub-menu'); 43 if (submenu) { 44 submenu.style.display = 'none'; // Hide 45 } 46 const toggle = menuItem.querySelector('.mega-menu-link'); 47 if (toggle) { 48 toggle.setAttribute('aria-expanded', 'false'); 49 } 50 } 51 event.preventDefault(); 52 event.stopPropagation(); 53 }); 54 }); 55 56 // MAIN MENU HOVER handler (restores submenu) 57 document.querySelectorAll('.mega-menu-item-has-children').forEach(function(menuItem) { 58 menuItem.addEventListener('mouseenter', function() { 59 const submenu = menuItem.querySelector('.mega-sub-menu'); 60 if (submenu && submenu.style.display === 'none') { 61 submenu.style.display = ''; // Reset to default, shows again 62 } 63 }); 64 // Optional: handle focusing main menu link for keyboard users 65 const toggle = menuItem.querySelector('.mega-menu-link'); 66 if (toggle) { 67 toggle.addEventListener('focus', function() { 68 const submenu = menuItem.querySelector('.mega-sub-menu'); 69 if (submenu && submenu.style.display === 'none') { 70 submenu.style.display = ''; // Reset on focus 71 } 72 }); 73 } 74 }); 75});
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.