1jQuery.noConflict(); 2 3(function($, window, document){ 4 var ElementorIsReadyFired = false; 5 $( window ).on( 'elementor/frontend/init', () => { 6 //it is already ready to fire 7 ElementorIsReadyFired = true; 8 }); 9 10 var onReady = function(){ 11 var typedJS = function($scope){ 12 $scope = typeof $scope === 'undefined'? $(document.body) : $scope; 13 14 var typed_texts = $scope.find('.a13ree-written-headline'); 15 16 if(typed_texts.length){ 17 var start_typing = function(heading){ 18 var block = $(heading), 19 writing_area = block.find('.written-lines'), 20 block_strings = writing_area.text().split('\n'), 21 is_loop = block.data('loop') == 1, 22 speed = block.data('speed'); 23 24 //skip if it was initialized already 25 if(writing_area.data('typed')){ 26 return; 27 } 28 29 writing_area 30 .removeClass('elementor-screen-only') 31 .empty() 32 .typed({ 33 strings: block_strings, 34 startDelay: 500, 35 typeSpeed: parseInt(speed, 10), 36 loop: is_loop 37 }); 38 39 }; 40 41 typed_texts.each( function(){ 42 var _this = this; 43 //native version 44 if(typeof Waypoint === 'function'){ 45 //noinspection JSUnusedGlobalSymbols 46 new Waypoint({ 47 element: _this, 48 handler: function(){ 49 start_typing(this.element); 50 //fire only once 51 this.destroy(); 52 }, 53 offset: 'bottom-in-view' 54 }); 55 } 56 //jQuery version 57 else if(typeof jQuery.waypoints === 'function'){ 58 $(this).waypoint( $.proxy(start_typing, this, this, 0),{ offset: 'bottom-in-view', triggerOnce:true } ); 59 } 60 //no waypoints script available 61 else{ 62 start_typing(); 63 } 64 } ); 65 } 66 }; 67 68 typedJS(); 69 70 var ElementorInitCallback = function(){ 71 if(typeof elementorFrontend !== 'undefined' && typeof elementorFrontend.hooks !== 'undefined'){ 72 elementorFrontend.hooks.addAction( 'frontend/element_ready/writing-effect-headline.default', function( $scope ) { 73 typedJS($scope); 74 } ); 75 } 76 }; 77 78 //if event didn't fire yet 79 $( window ).on( 'elementor/frontend/init', () => { 80 ElementorInitCallback(); 81 } ); 82 83 //if event occured before the ready event, lets fire 84 if(ElementorIsReadyFired === true){ 85 ElementorInitCallback(); 86 } 87 88 }; 89 90 $(document).ready(onReady); 91})(jQuery, window, document);
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.