1function getBroVol() { 2 var myWidth = 0, 3 myHeight = 0, 4 _vol = {}; 5 if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { 6 myWidth = document.documentElement.clientWidth; 7 myHeight = document.documentElement.clientHeight; 8 } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { //IE9 9 myWidth = document.body.clientWidth; 10 myHeight = document.body.clientHeight; 11 } else if (document.body && document.body.offsetWidth) { 12 myWidth = document.body.offsetWidth; 13 myHeight = document.body.offsetHeight; 14 } else if (document.compatMode == 'CSS1Compat' && document.documentElement && document.documentElement.offsetWidth) { 15 myWidth = document.documentElement.offsetWidth; 16 myHeight = document.documentElement.offsetHeight; 17 } 18 this.h = myHeight; 19 this.w = myWidth; 20 return; 21} 22function calculateAspectRatioFit(srcWidth, srcHeight, maxWidth, maxHeight) { 23 24 var ratio = Math.min(maxWidth / srcWidth, maxHeight / srcHeight); 25 26 return { width: srcWidth*ratio, height: srcHeight*ratio }; 27 } 28 29 30 (function ($) { 31 $.fn.setFrags = function (options) { 32 var settings = { 33 shiftTo: 2, 34 fold: 'cont' 35 }; 36 options = $.extend(settings, options); 37 var $element = $(this); 38 39 if ($element.find(options.child).parent().is("." + options.fold)) { 40 $element.find(options.child).unwrap(); 41 42 } 43 44 return $element.find(options.child).each(function (index, el) { 45 // console.log($(this)); 46 // index % options.shiftTo === 0 ? $(this).wrap("<div class='frag cf flex justify-left align-center " + options.fold + "'></div>") : $element.find('.frag').eq($element.find('.frag').length - 1).append($(this)); 47 index % options.shiftTo === 0 ? $(this).wrap("<div class='frag cf " +options.claz+" "+ options.fold + "'></div>") : $element.find('.frag').eq($element.find('.frag').length - 1).append($(this)); 48 49 if (index >= $element.find(options.child).length) { 50 console.log('df'); 51 } 52 }); 53 }; 54 })(jQuery); 55 // $('#milestone').find('.sec').unwrap(); 56 57 58(function ($) { 59 $.fn.imageResize = function (options) { 60 var settings = { 61 width: 150, 62 height: 150, 63 asp: 343 / 373, 64 targ:'' 65 }; 66 options = $.extend(settings, options); 67 return this.each(function () { 68 var $element = $(this); 69 $element.css("height", $(this).parent().width() * options.asp); 70 }); 71 }; 72 })(jQuery); 73(function ($) { 74 $.fn.setEqH = function (options) { 75 var settings = { parent: 0,oh:0},temp=0; 76 options = $.extend(settings, options); 77 this.each(function (index,el) { 78 var $element = $(this); 79 // console.log($element.height()); 80 if(temp<$(this)[(options.oh == 1)?'outerHeight':'height']())temp=$(this)[(options.oh == 1)?'outerHeight':'height']() 81 }); 82 return (options.parent == 1)?this.parent().css('height', temp):this.css('height', temp); 83 }; 84})(jQuery); 85function broW() { 86 return new getBroVol().w; 87} 88var touch = is_touch_device(); 89function is_touch_device() { 90 return (('ontouchstart' in window) 91 || (navigator.MaxTouchPoints > 0) 92 || (navigator.msMaxTouchPoints > 0)); 93}; 94function Slider(_tar, _dly, _fd ) { 95 this.tns = _fd; 96 this.delay = _dly; 97 this.init(_tar); 98 } 99 Slider.prototype.init = function (_tar) { 100 101 this.crt = 0; 102 this.prt = 0; 103 this.cont = $(_tar); 104 this.img = this.cont.find('.slider-cont').children('.slides'); 105 this.imgsLeng = this.img.length; 106 var $this = this; 107 this.setTime; 108 this.clc = true; 109 this.cont.find('.navz')[(this.img.length<2)?'hide':'show'](); 110 this.cont.find('.navz').find('.nv').on("click", this.slideHandler.bind(this)); 111// this.cont.find('.navz').find('.nv').on("click", this.slideHandler.bind(this)); 112 this.auto(); 113 this.cont.find('.cnt').text((this.crt + 1) + '/' + this.imgsLeng) 114 this.tns = (this.tns == undefined)?'fade':this.tns; 115 this[this.tns](); 116 $this.cont.find('.slider-sel').empty() 117 // console.log(this.cont); 118 this.img.each(function (i) { 119 $this.cont.find('.slider-sel').append($('<span/>').attr('id', i)); 120 }); 121 this.cont.find('.slider-sel').find('span').eq(0).addClass('act'); 122 this.cont.find('.slider-sel').find('span').not('.act').on("click", this.slideHandler.bind(this)) 123 }; 124 Slider.prototype.slideHandler = function (e) { 125 clearInterval(this.setTime); 126 this.cords(($(e.target).data('dir')) ? $(e.target).data('dir') : $(e.target).index()); 127 this.auto(); 128 }; 129 Slider.prototype.auto = function (e) { 130 var $this = this; 131 this.setTime = setInterval(function () { 132 $this.cords('auto'); 133 }, this.delay); 134 }; 135 Slider.prototype.pause = function (e) { 136 clearInterval(this.setTime); 137 } 138 Slider.prototype.cords = function (_dr) { 139 if (this.clc) { 140 this.clc = false;
141 var dr, pos = this.crt, $this = this; 142 pos += (~~((dr = (_dr === 'prev') ? -1 : 1) === 1) || -1); 143// this.crt = (typeof _dr == 'string') ? ( (pos < 0) ? this.imgsLeng - 1 : ((_dr === 'auto') ? pos % this.imgsLeng : ((pos < this.imgsLeng) ? pos % this.imgsLeng : 0)) ) : _dr; 144// console.log(this.crt) 145 this.crt = (typeof _dr == 'string')?( (pos < 0)?this.imgsLeng - 1:pos % this.imgsLeng):_dr 146//console.log($this.prt,$this.crt) 147 //if($this.prt != $this.crt){ 148 // if(_dr == 'auto'){ 149 // this.crt = (typeof _dr == 'string')?( (pos < 0)?this.imgsLeng - 1:pos % this.imgsLeng):_dr 150 // }else{ 151 // this.crt = (typeof _dr == 'string')?( (pos < 0)?0:( (pos<this.imgsLeng-1)?pos % this.imgsLeng:this.imgsLeng-1)):_dr 152 // } 153 154 this.cont.find('.slider-sel').find('span').eq(this.crt).addClass('act').siblings().removeClass('act'); 155 // if ((typeof _dr !== 'string')) 156 dr = (this.prt > this.crt) ? -1 : 1; 157 this.cont.find('.slider-sel').find('span').off("click") 158 this.cont.find('.slider-sel').find('span').not('.act').on("click", this.slideHandler.bind(this)); 159 this.vl = 100;// (this.cont.is('#slider')) ? 100 : 120; 160 this[this.tns](dr) 161 this.cont.find('.cnt').text((this.crt + 1) + '/' + this.imgsLeng) 162 //} 163 $this.prt = $this.crt; 164 } 165 }; 166 Slider.prototype.slide = function (_dr) { 167 var $this = this; 168 this.img.eq(this.crt).css({'left': (_dr * this.vl) + '%', opacity: 1}).stop().animate({left: 0, opacity: 1}, 900, 169 function () { 170 $this.clc = true; 171 }).addClass('act'); 172 this.img.eq(this.prt).stop().animate({opacity: 1, left: (-(_dr * this.vl)) + '%'}, 1000).removeClass('act'); 173 } 174 Slider.prototype.slideup = function (_dr) { 175 var $this = this; 176 this.img.eq(this.crt).css({'top': (_dr * this.vl) + '%', opacity: 1}).stop().animate({top: 0, opacity: 1}, 900, 177 function () { 178 $this.clc = true; 179 }).addClass('act'); 180 this.img.eq(this.prt).stop().animate({opacity: 1, top: (-(_dr * this.vl)) + '%'}, 1000).removeClass('act'); 181 } 182 Slider.prototype.fade = function (_dr) { 183 var $this = this; 184 this.img.eq(this.crt).fadeIn(900, function () { 185 $this.clc = true; 186 }).addClass('act').siblings('.slides').fadeOut().removeClass('act'); 187 }
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.