芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/www/wp-content/themes/brunn/assets/js/modules/a-global.js
(function ($) { "use strict"; window.qodef = {}; qodef.modules = {}; qodef.scroll = 0; qodef.window = $(window); qodef.document = $(document); qodef.windowWidth = $(window).width(); qodef.windowHeight = $(window).height(); qodef.body = $('body'); qodef.html = $('html, body'); qodef.htmlEl = $('html'); qodef.menuDropdownHeightSet = false; qodef.defaultHeaderStyle = ''; qodef.minVideoWidth = 1500; qodef.videoWidthOriginal = 1280; qodef.videoHeightOriginal = 720; qodef.videoRatio = 1.61; qodef.qodefOnDocumentReady = qodefOnDocumentReady; qodef.qodefOnWindowResize = qodefOnWindowResize; qodef.qodefOnWindowScroll = qodefOnWindowScroll; $(document).ready(qodefOnDocumentReady); $(window).resize(qodefOnWindowResize); $(window).scroll(qodefOnWindowScroll); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodef.scroll = $(window).scrollTop(); //set global variable for header style which we will use in various functions if (qodef.body.hasClass('qodef-dark-header')) { qodef.defaultHeaderStyle = 'qodef-dark-header'; } if (qodef.body.hasClass('qodef-light-header')) { qodef.defaultHeaderStyle = 'qodef-light-header'; } } /* All functions to be called on $(window).resize() should be in this function */ function qodefOnWindowResize() { qodef.windowWidth = $(window).width(); qodef.windowHeight = $(window).height(); } /* All functions to be called on $(window).scroll() should be in this function */ function qodefOnWindowScroll() { qodef.scroll = $(window).scrollTop(); } //set boxed layout width variable for various calculations switch (true) { case qodef.body.hasClass('qodef-grid-1300'): qodef.boxedLayoutWidth = 1350; //qodef.gridWidth = 1300; break; case qodef.body.hasClass('qodef-grid-1200'): qodef.boxedLayoutWidth = 1250; //qodef.gridWidth = 1200; break; case qodef.body.hasClass('qodef-grid-1000'): qodef.boxedLayoutWidth = 1050; //qodef.gridWidth = 1000; break; case qodef.body.hasClass('qodef-grid-800'): qodef.boxedLayoutWidth = 850; //qodef.gridWidth = 800; break; default : qodef.boxedLayoutWidth = 1150; //qodef.gridWidth = 1100; break; } qodef.gridWidth = function () { var gridWidth = 1100; switch (true) { case qodef.body.hasClass('qodef-grid-1300') && qodef.windowWidth > 1400: gridWidth = 1300; break; case qodef.body.hasClass('qodef-grid-1200') && qodef.windowWidth > 1300: gridWidth = 1200; break; case qodef.body.hasClass('qodef-grid-1000') && qodef.windowWidth > 1200: gridWidth = 1200; break; case qodef.body.hasClass('qodef-grid-800') && qodef.windowWidth > 1024: gridWidth = 800; break; default : break; } return gridWidth; }; qodef.transitionEnd = (function () { var el = document.createElement('transitionDetector'), transEndEventNames = { 'WebkitTransition' : 'webkitTransitionEnd',// Saf 6, Android Browser 'MozTransition' : 'transitionend', // only for FF < 15 'transition' : 'transitionend' // IE10, Opera, Chrome, FF 15+, Saf 7+ }; for(var t in transEndEventNames){ if( el.style[t] !== undefined ){ return transEndEventNames[t]; } } })(); qodef.animationEnd = (function() { var el = document.createElement("animationDetector"); var animations = { "animation" : "animationend", "OAnimation" : "oAnimationEnd", "MozAnimation" : "animationend", "WebkitAnimation": "webkitAnimationEnd" }; for (var t in animations){ if (el.style[t] !== undefined){ return animations[t]; } } })(); })(jQuery);