1/** 2 * Child Theme Scripts 3 * 4 * Custom Javascript code 5 */ 6(function($) { 7 $(document).ready(function() { 8 wecmInit(); 9 }); 10 11 $(window).on('load', function() { 12 13 // Image Slider 14 if ($('.cm-slider').length) { 15 $('.cm-slider').flexslider({ 16 animation: 'slide' 17 }); 18 } 19 20 // Content Slider 21 if ($('.cm-content-slider').length) { 22 $('.cm-content-slider').flexslider({ 23 animation: 'slide' 24 }); 25 } 26 }); 27 28 $(window).on('scroll', function() { 29 30 // Animate Steps 31 if ($('.cm-step').length) { 32 $('.cm-step').each(function() { 33 if (isInViewport($(this))) { 34 $(this).addClass("cm-animate"); 35 } 36 }); 37 } 38 }); 39 40 /** 41 * Check if element is in viewport 42 */ 43 function isInViewport(element) { 44 var windowTop = $(window).scrollTop(); 45 var elementTop = $(element).offset().top; 46 var windowBottom = windowTop + $(window).height(); 47 var elementBottom = elementTop + ($(element).height() / 4); 48 return ((elementBottom <= windowBottom) && (elementTop >= windowTop)); 49 } 50 51 function wecmInit() { 52 console.log('Design und Entwicklung\n======================\n\nWebentwickler Christian Maul\n\nMail: [email protected]\nWeb: https://www.christianmaul.de'); 53 } 54}(jQuery));
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.