// 加载一个脚本文件 function _loadJsFile(url, callback) { var script = document.createElement("script"); if(script.readyState) { script.onreadystatechange = function() { if(script.readyState == "loaded" || script.readyState == "complete") { callback.call(); } } } else { script.onload = callback; } script.type = "text/javascript"; //script.async = true; script.src = url; //url.indexOf('?') != -1 ? url + '&v=' + version : url + '?v=' + version; document.getElementsByTagName("head")[0].appendChild(script); } //移动端加载js if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { /* _loadJsFile('js/wapbanner.js'); */ $("#wapguide3").show(); } // 第三步: 实例化 var anim1 = lottie.loadAnimation({ container: document.getElementById("lottie1"), // 容器 renderer: "svg", loop: true, autoplay: true, // animationData: {}, //如果使用的是JSON path: "lottie/tips_click.json" // the path to the animation json }); var anim2 = lottie.loadAnimation({ container: document.getElementById("lottie2"), // 容器 renderer: "svg", loop: true, autoplay: true, // animationData: {}, //如果使用的是JSON path: "lottie/tips_rotate.json" // the path to the animation json }); anim1.play(); anim1.setSpeed(0.5) anim2.play(); $("#guide-close").click(function() { $(".guide").hide(); })