| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- function screenClass() {
- // ADD A CLASS Start
- "use strict";
- if ($(window).innerWidth() <= 767) {
- $('body').addClass('mobile-screen').removeClass('desktop-screen');
- } else {
- $('body').addClass('desktop-screen').removeClass('mobile-screen');
- }
- // ADD A CLASS End
- // KOPIEREN EINES ELEMENTS AN EINE ANDERE STELLE Start
- // Icons
- if ($(window).innerWidth() <= 575.98) {
- $('#append').appendTo($('#append_paste'));
- }
- // KOPIEREN EINES ELEMENTS AN EINE ANDERE STELLE End
- // BUGFIX APPLE DEVICES 100vh Start
- const appHeight = () => {
- const doc = document.documentElement
- doc.style.setProperty('--app-height', `${window.innerHeight}px`)
- }
- window.addEventListener('resize', appHeight)
- appHeight()
- // BUGFIX APPLE DEVICES 100vh End
- }
- screenClass();
- $(document).ready(function () {
- // SHRINK Start
- $(window).scroll(function () {
- if ($(document).scrollTop() > 100) {
- $('.default-header').addClass('shrink');
- } else {
- $('.default-header').removeClass('shrink');
- }
- // SHRINK End
- /* BACK TO TOP PLUGIN */
- if ($(this).scrollTop() >= 1000) {
- $('.backtotop').fadeIn();
- } else {
- $('.backtotop').fadeOut();
- }
- });
- $('.backtotop').click(function () {
- $('body,html').animate(0, 800);
- $('body,html').animate({
- scrollTop: 0
- }, 800);
- return false;
- });
- /* CLOSE BACK TO TOP PLUGIN */
- // REPLACE SVG Start
- jQuery('img.svg').each(function(){
- var $img = jQuery(this);
- var imgID = $img.attr('id');
- var imgClass = $img.attr('class');
- var imgURL = $img.attr('src');
-
- jQuery.get(imgURL, function(data) {
- // Get the SVG tag, ignore the rest
- var $svg = jQuery(data).find('svg');
-
- // Add replaced image's ID to the new SVG
- if(typeof imgID !== 'undefined') {
- $svg = $svg.attr('id', imgID);
- }
- // Add replaced image's classes to the new SVG
- if(typeof imgClass !== 'undefined') {
- $svg = $svg.attr('class', imgClass+' replaced-svg');
- }
-
- // Remove any invalid XML tags as per http://validator.w3.org
- $svg = $svg.removeAttr('xmlns:a');
-
- // Replace image with new SVG
- $img.replaceWith($svg);
-
- }, 'xml');
-
- });
- /* REPLACE SVG End */
- // STACK MENU Start
- $('#stack-menu').stackMenu({
- //all: true, // add links to parents
- //allTitle: 'All' // parents links text
- });
- var trigger = $('.jumpmark_selector');
- var list = $('.jumpmark_container');
- trigger.click(function() {
- trigger.toggleClass('active');
- list.slideToggle(200);
- });
- // this is optional to close the list while the new page is loading
- list.click(function() {
- trigger.click();
- });
- // STACK MENU End
- // document.ready End
- });
|