PageSourceSearch

https://milmi.org/_files/js/scripts.js

js milmi.org collected 2026-09-24 19:40:56 UTC 3,335 bytes, 106 lines download raw bytes

1$(document).ready(function(){
2	$(window).scroll(function () {
3	    //Back To Top Link
4		if ($(this).scrollTop() > 50) {
5			$('#back-to-top').fadeIn();
6		} else {
7			$('#back-to-top').fadeOut();
8		}
9		//Logo Shrinker
10		var nav = $('#header-logo');
11        var top = 200;
12        if ($(window).scrollTop() >= top) {
13            nav.addClass('tiny');
14        } else {
15            nav.removeClass('tiny');
16        }
17	});
18	// scroll body to 0px on click
19	$('#back-to-top').click(function () {
20		$('body,html').animate({
21			scrollTop: 0
22		}, 400);
23		return false;
24	});
25	
26	(function ($) {
27      // Control buttons
28      $('.tile-carousel .next').click(function (e) {
29        $(e.target).closest('.tile-carousel').carousel('next');
30        return false;
31      });
32      $('.tile-carousel .prev').click(function (e) {
33        $(e.target).closest('.tile-carousel').carousel('prev');
34        return false;
35      });
36    
37      // On carousel scroll
38      $(".tile-carousel").on("slide.bs.carousel", function (e) {
39        let $e = $(e.relatedTarget);
40        let $target = $(e.target);
41        let idx = $e.index();
42        let itemsPerSlide = 4;
43        let totalItems = $(".carousel-item").length;
44        if (idx >= totalItems - (itemsPerSlide - 1)) {
45          let it = itemsPerSlide - (totalItems - idx);
46          for (let i = 0; i < it; i++) {
47            // append slides to end 
48            if (e.direction === "left") {
49              $target.find(".carousel-item").eq(i).appendTo($target.find(".carousel-inner"));
50            } else {
51              $target.find(".carousel-item").eq(0).appendTo($target.find(".carousel-inner"));
52            }
53          }
54        }
55      });
56    })(jQuery);
57});
58
59// Bootstrap Carousel & Animate.css
60(function($) {
61  //Function to animate slider captions
62  function doAnimations(elems) {
63    //Cache the animationend event in a variable
64    var animEndEv = "webkitAnimationEnd animationend";
65
66    elems.each(function() {
67      var $this = $(this),
68        $animationType = $this.data("animation");
69      $this.addClass($animationType).one(animEndEv, function() {
70        $this.removeClass($animationType);
71      });
72    });
73  }
74
75  //Variables on page load
76  var $myCarousel = $("#carousel"),
77    $firstAnimatingElems = $myCarousel
78      .find(".carousel-item:first")
79      .find("[data-animation ^= 'animated']");
80
81  //Initialize carousel
82  $myCarousel.carousel();
83
84  //Animate captions in first slide on page load
85  doAnimations($firstAnimatingElems);
86
87  //Other slides to be animated on carousel slide event
88  $myCarousel.on("slide.bs.carousel", function(e) {
89    var $animatingElems = $(e.relatedTarget).find(
90      "[data-animation ^= 'animated']"
91    );
92    doAnimations($animatingElems);
93  });
94})(jQuery);
95
96//Multilevel dropdown
97$('.dropdown-menu a.dropdown-toggle:not(.hover)').on('click', function(e) {
98    if (!$(this).next().hasClass('show')) {
99        $(this).parents('.dropdown-submenu').first().find('.show').removeClass("show");
100    }
101    $(this).next(".dropdown-submenu").toggleClass('show');
102    $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function(e) {
103        $(e.target).find('.dropdown-submenu.show').removeClass("show");
104    });
105    return false;
106});

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.