/*! * WFFW(Webfront Framework) of W3SDK - w3sdk-1.5.0-beta (http://w3cut.cn Copyright©2019 W3) * * style - 2019/12/20 * 说明:统一脚本 * 用法:html 文件中引用 */ //CONFIGURATION window.W = { Name: "w3sdk", Version: "w3sdk-1.5.0-beta", IsDev: false, ScrollTopHack: true, AppType: "pcs", // include "pco", "pcs", "wap", WapWidth: 375, MediaPoints: { xs: 0, sm: 576, md: 768, lg: 992, xl: 1200, xxl: 1400, xxxl: 1600 }, Duration: 300 }; $(function() { W.init = function() { if (W.IsDev) { console.info("%s: ok", W.Version); if (W.ScrollTopHack) { setTimeout(function() { var scrollTop = location.hash.substr(1); $("html, body").scrollTop(scrollTop); }, 100); } } // // EVENTS // var resize = function() { var w = $(window).width(); var h = $(window).height(); $(".j-fullHeight").height(h - $("header").height() - $("footer").height()); if (w < W.MediaPoints.md) { $("body").addClass("lt"); $("body").removeClass("eq"); } else { $("body").removeClass("lt"); $("body").addClass("eq"); } if (W.AppType == "wap") { var r = w / W.WapWidth; $("html").css("font-size", 10 * r + "px"); } // // MAINCODE // }; $(window).resize(function() { resize(); }); resize(); var scroll = function() { var h = $(window).height(); var sTop = $(window).scrollTop(); var sBottom = h - ($("body").height() - sTop); if (W.IsDev && W.ScrollTopHack && sTop > 0) { location.hash = "#" + sTop; } if (sTop > h * 0.2) { $("body").addClass("on-scro"); } else { $("body").removeClass("on-scro"); } // // MAINCODE // }; $(window).scroll(function() { scroll(); }); // // MAINCODE // new WOW({}).init(); $("header .mbtn").click(function() { $("body").toggleClass("on-menu"); return false; }); $("footer .back").click(function() { $("html, body").animate({ scrollTop: 0 }, W.Duration); return false; }); $(".scroll").scroll({ speed: 80, direction: "horizantal" }); }; W.init(); }); function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ if(window.netscape){ try{ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }catch(e){ alert("抱歉,此操作被浏览器拒绝!\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'"); } }else{ alert("抱歉,您所使用的浏览器无法完成此操作。\n\n您需要手动将【"+url+"】设置为首页。"); } } } //收藏本站 function AddFavorite(title, url) { try { window.external.addFavorite(url, title); } catch (e) { try { window.sidebar.addPanel(title, url, ""); } catch (e) { alert("抱歉,您所使用的浏览器无法完成此操作。\n\n加入收藏失败,请使用Ctrl+D进行添加"); } } }