PageSourceSearch

https://www.wasserstoff-leitprojekte.de/lw_resource/layoutfiles/js/main.js

js wasserstoff-leitprojekte.de collected 2026-10-03 21:06:00 UTC 3,880 bytes, 139 lines download raw bytes

1
2$( document ).ready(function () {        
3    // Accordion Fix Start
4    var accordions = $('div.auto-close');
5    var counter = 1;
6    var currentId = "";
7    accordions.each(function() {
8        currentId = "accordion" + counter;
9        $(this).attr('id', currentId); 
10        $(this).find('[data-parent="#accordion"]').each(function() {
11            $(this).attr('data-parent', "#" + currentId);
12        });
13        counter++;
14    });
15    //Accordion Fix End
16	var topnavHeight = $('#topnav').outerHeight();
17	var headerHeight = 0;
18	var combinedHeight = 0;
19	
20	$('#header').imagesLoaded( function() {
21		headerHeight = $('#header').outerHeight();
22		combinedHeight = (topnavHeight + headerHeight);
23	});
24	
25    $(window).scroll(function () {
26        if ($(this).scrollTop() > 100) {
27            $('.scrollup').fadeIn();
28        } else {
29            $('.scrollup').fadeOut();
30        }
31		if ($(window).width() >= 992) {
32			if ($(this).scrollTop() > combinedHeight + 40) {
33				$('#wrap').addClass('scrolled');
34				$('#nav-container').addClass('scrolled');
35			} else {
36				$('#wrap').removeClass('scrolled');
37				$('#nav-container').removeClass('scrolled');
38			}
39		}
40    });
41
42    $('.totop').click(function () {
43        $("html, body").animate({
44            scrollTop: 0
45        }, 600);
46        return false;
47    });
48	
49	if (!$('#nav-container').hasClass('scrolled')) {
50		$('#navbar .nav > li > a').click(function () {
51			$("html, body").animate({
52				//scrollTop: $("#navbar").offset().top
53			}, 100);
54		});
55	}
56	
57	if ($('.fancy').length > 0) {
58		$(".fancy").fancybox();
59	}
60	
61	$('a.accordion-toggle').click(function() {     			
62		if (!$('> span:last-child', this).hasClass('fa-chevron-down')) {	
63			//$('a.accordion-toggle > i').removeClass('icon-minus').addClass('icon-plus');				
64			$('> span:last-child', this).removeClass('fa-chevron-up').addClass('fa-chevron-down');					
65		} else {
66			//$('a.accordion-toggle > i').removeClass('icon-minus').addClass('icon-plus');
67			$('> span:last-child', this).removeClass('fa-chevron-down').addClass('fa-chevron-up');
68		}					
69	}); 
70	
71	$('#page-search > .input-group-addon').click(function() {	
72		if ($(window).width() <= 992) {
73			$('#page-search').toggleClass('clicked');	
74		}
75	});  
76	$('#bmbf-search-button-nav').click(function() {	
77		$(this).toggleClass('clicked');	
78	}); 	
79	$('#mobile-buttons .btn').click(function() {	
80		$(this).siblings('.clicked').click();
81		$(this).toggleClass('clicked');
82	});
83});
84
85var fixDivHeightByClassInArea = function(classID, area) {
86	var divs = area.find(classID);
87	var maxHeight = 0;
88	divs.each(function() {
89		maxHeight = maxHeight > $(this).outerHeight(true) ? maxHeight : $(this).outerHeight(true);
90	});
91	divs.each(function() {
92		$(this).height(maxHeight);
93	});
94};
95
96var resetHeightByClassInArea = function(classID, area) {
97	var divs = area.find(classID);
98	divs.each(function() {
99		$(this).height('initial');
100	});
101};
102
103$(window).on('resize', function() {
104	if ($(window).width() >= 992) {
105		$('#page-search').removeClass('clicked');	
106	}
107	if ($(window).width() >= 1024) {
108		if ($(this).scrollTop() > 200) {
109			$('#nav-container').addClass('scrolled');
110		} else {
111			$('#nav-container').removeClass('scrolled');
112		}
113	} else {
114		$('#nav-container').removeClass('scrolled');
115	}
116	
117	if ($(window).width() < 768) {
118		$('#main').find('.flex-height').height('auto');
119	}
120	else {
121		resetHeightByClassInArea('.flex-height', $('#main'));
122		fixDivHeightByClassInArea('.flex-height', $('#main'));
123	}
124});
125
126 $(window).on('load', function () {
127	$(window).resize(); 
128	var hash = window.location.hash;
129	if(hash) {
130		var scrollLocation = ($(hash).offset().top -240);
131		$("html, body").animate({
132			scrollTop: scrollLocation
133		}, 300);
134		$(hash).find("a.accordion-toggle").click();
135	}
136 });
137
138
139

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.