1var timeTip = document.createElement('p'); 2timeTip.className = 'timeTip'; 3var $playBtn = $('.audioPlay'), 4 $waveLength = parseInt($('.audioItem .time-bar').css('width')), 5 oldPlayItem = null, 6 hasOtherPlay = false, 7 isDetailPage = false; 8window.onresize = function () { 9 $waveLength = parseInt($('.audioItem .time-bar').css('width')); 10 audiosInit(); 11} 12$(function(){ 13 $("body").on("click", ".closeBtn", function () { 14 $(this).parent().parent().hide(); 15 $(".circleBox").removeClass('running'); 16 $(".audioPlay").removeClass('pause-icon'); 17 audiosInit(); 18 clearInterval($audioInterval); 19 }); 20 audiosInit(); 21 $(".audioItem .AudioprogressBox").click(function(e){ 22 window.event ? window.event.cancelBubble = true : e.stopPropagation(); 23 return false; 24 }); 25 $('body').on('click','.btmaudioBox .statusIcon',function(){ 26 var idclass = $(this).parents('.btmaudioBox').attr('data-id'); 27 $('.bglist_'+idclass).find('.audioPlay').click(); 28 return false; 29 }); 30 $('body').on('click', '.audioItem .statusIcon', function(){ 31 $(this).parents('.audioItem').find('.audioPlay').click(); 32 window.event ? window.event.cancelBubble = true : e.stopPropagation(); 33 return false; 34 }); 35 36}); 37// é³é¢ææ¾ 38function audiosInit() { 39 $('.audioPlay').each(function (i, ele) { 40 var that = this, 41 $this = $(this); 42 this.isPlay = true; 43 this.showTime = 0; 44 this.first = true; 45 this.$thisAudio = $this 46 .parents('.audioItem') 47 .find('audio'); 48 this.audio = this 49 .$thisAudio 50 .get(0); 51 52 this.$toTime = this 53 .$thisAudio 54 .data("time"); 55 // this.$toTime = Math.ceil(this.audio.duration); 56 this.pgBar = $this 57 .parents('.audioItem') 58 .find('.time-bar') 59 .get(0); 60 this.pgBar.pgBarClientLeft = this 61 .pgBar 62 .getBoundingClientRect() 63 .left; 64 this.pgBar.audio = this.audio; 65 this.pgBar.$toTime = this.$toTime; 66 this.pgBar.timeTip = timeTip; 67 this.pgBar.audioBox = $this 68 .parents('.audioItem') 69 .find('.AudioprogressBox') 70 .get(0); 71 this.pgBar.$timeTipbox = $this 72 .parents('.audioItem') 73 .find('.AudioprogressBox') 74 .get(0);; 75 // this.pgBar.toParLeft = $(this.pgBar).position().left; 76 this.pgBar.toParLeft = this.pgBar.pgBarClientLeft - this 77 .pgBar 78 .audioBox 79 .getBoundingClientRect() 80 .left; 81 that.$curTime = $this 82 .parents('.audioItem') 83 .find('.star-time'); 84 that.$moveColor = $this 85 .parents('.audioItem') 86 .find('.time-bar') 87 .find('.move-color'); 88 that.$rotateImg = $this 89 .parents('.audioItem') 90 .find('.circleBox'); 91 92 if ($this.parents('.work-info-wrap').length > 0) { 93 $waveLength = parseInt($(this.pgBar).css('width')); 94 } 95 if ($this.parents('.detail-style').length > 0) { 96 $waveLength = parseInt($(this.pgBar).css('width')); 97 } 98 that.t = TweenMax.to(that.$moveColor, that.$toTime, { 99 width: $waveLength, 100 ease: Linear.easeNone, 101 onComplete: function () { 102 that 103 .$moveColor 104 .css('width', 0); 105 } 106 }); 107 that 108 .t 109 .pause(); 110 that.audio.onended = function () { 111 clearInterval(that.$audioInterval); 112 that 113 .t 114 .seek(that.$toTime); 115 that 116 .$moveColor 117 .css('width', 0); 118 that 119 .$curTime 120 .text('00:00');
121 $(that).removeClass('pause-icon'); 122 that 123 .$rotateImg 124 .removeClass('running'); 125 that.isPlay = true; 126 hasOtherPlay = false; 127 that.first = true; 128 btmPlay($(that.audio).parents('.audioItem')); 129 } 130 //ä¿®æ¹è¿åº¦ 131 this.pgBar.onmouseover = function (e) { 132 this 133 .audioBox 134 .appendChild(countTips(e, this)); 135 this.onmousemove = function (e) { 136 countTips(e, this); 137 }; 138 this.onmouseout = function () { 139 this 140 .audioBox 141 .removeChild(this.timeTip); 142 } 143 this.onclick = function (e) { 144 var willTo = Math.round((e.clientX - this.pgBarClientLeft) / $waveLength * this.$toTime); 145 that 146 .t 147 .seek(willTo); 148 this.audio.currentTime = willTo; 149 if (this.audio.paused) { 150 that 151 .t 152 .resume(); 153 this 154 .audio 155 .play(); 156 doPlay(that); 157 window.onblur = function () { 158 doPause(that); 159 that.isPlay = true; 160 } 161 that.isPlay = !that.isPlay; 162 } 163 }; 164 165 function countTips(e, that) { 166 var $that = $(that); 167 if ($that.parents('.work-info-wrap').length > 0) { 168 $waveLength = parseInt($that.css('width')); 169 } 170 if ($that.parents('.detail-style').length > 0) { 171 $waveLength = parseInt($that.css('width')); 172 } 173 var willTo = Math.round((e.clientX - that.pgBarClientLeft) / $waveLength * that.$toTime); 174 var minute = willTo / 60; 175 var second = willTo % 60; 176 177 if(minute<=9){ 178 minute = "0"+parseInt(minute); 179 } 180 if(second<=9&&second>0){ 181 second = "0"+parseInt(second); 182 }else if(second<=0){ 183 second = "00"; 184 } 185 that.timeTip.innerHTML = minute +":"+ second; 186 /*if (willTo <= 9) { 187 that.timeTip.innerHTML = "0"+parseInt(minute) + ":0" + second; 188 } else { 189 that.timeTip.innerHTML = parseInt('0' + minute) + ":" + second; 190 }*/ 191 that.timeTip.style.left = e.clientX - that.pgBarClientLeft + that.toParLeft - 20 + 'px'; 192 return that.timeTip; 193 } 194 } 195 196 function btmPlay(obj){ 197 var btmaudioBox = $('.btmaudioBox'); 198 if(btmaudioBox&&btmaudioBox.length>0){ 199 var audiosrc = obj.find('audio').prop('src'); 200 var img = obj.find('.circleBox').find('img').prop('src'); 201 var endtime = obj.find('.end-time').text(); 202 var data = obj.find('.collect-btn').attr('data'); 203 var rTitle = obj.find('.r-title').text(); 204 var rForm = obj.find('.r-form').text(); 205 var starTime = obj.find('.star-time').text(); 206 var moveColorpt = obj.find('.time-bar').css('width'); 207 var moveColor = obj.find('.move-color').css('width'); 208 var circleBoxclass = obj.find('.circleBox'); 209 var bl = parseInt(moveColor)/parseInt(moveColorpt); 210 if(btmaudioBox.hasClass('show')){ 211 212 }else{ 213 btmaudioBox.addClass('show') 214 } 215 var timeBar = $('.btmaudioBox').find('.time-bar').css('width'); 216 timeBar = parseInt(timeBar)*bl; 217 btmaudioBox.attr('data-id',data); 218 btmaudioBox.find('audio').prop('src',audiosrc); 219 btmaudioBox.find('.circleBox').find('img').prop('src',img); 220 btmaudioBox.find('.top-title').text(rTitle); 221 btmaudioBox.find('.btm-name .formname').text(rForm); 222 btmaudioBox.find('.move-color').css('width',timeBar+"px");
223 btmaudioBox.find('.star-time').css('width',timeBar+"px"); 224 btmaudioBox.find('.circleBox').removeClass('running'); 225 if(circleBoxclass.hasClass('running')){ 226 btmaudioBox.find('.circleBox').addClass('running'); 227 } 228 } 229 } 230 function doPlay(that) { 231 if (hasOtherPlay || oldPlayItem != that) { 232 if (oldPlayItem) { 233 var $old = $(oldPlayItem); 234 clearInterval(oldPlayItem.$audioInterval); 235 oldPlayItem 236 .$rotateImg 237 .removeClass('running'); 238 oldPlayItem 239 .$thisAudio 240 .get(0) 241 .pause(); 242 oldPlayItem 243 .t 244 .pause(); 245 $old.removeClass('pause-icon'); 246 oldPlayItem.isPlay = true; 247 } 248 } 249 that 250 .$rotateImg 251 .addClass('running'); 252 $this.addClass('pause-icon'); 253 that.$audioInterval = setInterval(function () { 254 fun(that); 255 }, 16); 256 hasOtherPlay = true; 257 oldPlayItem = that; 258 } 259 function fun(audio) { 260 audio.showTime = Math.floor(audio.$thisAudio.get(0).currentTime); 261 var minute = audio.showTime / 60; 262 var second = audio.showTime % 60; 263 if(minute<=9){ 264 minute = '0'+parseInt(minute); 265 } 266 if(second<=9){ 267 second = '0'+second; 268 } 269 audio.$curTime.text( minute +":"+ second); 270 btmPlay($(audio).parents('.audioItem')); 271 } 272 function doPause(that) { 273 clearInterval(that.$audioInterval); 274 that 275 .$rotateImg 276 .removeClass('running'); 277 that.pauseTime = that.audio.currentTime; 278 that 279 .audio 280 .pause(); 281 that 282 .t 283 .pause(); 284 $this.removeClass('pause-icon'); 285 hasOtherPlay = false; 286 var obj = $(that).parents('.audioItem'); 287 btmPlay(obj); 288 } 289 //ææ¾æå 290 $(this) 291 .click(function () { 292 var $this = $(this), 293 that = this; 294 if (this.isPlay) { 295 if (that.first) { 296 if (that.t.progress() == 1) { 297 that 298 .t 299 .progress(0); 300 } 301 that 302 .t 303 .resume(); 304 305 /*window.onblur = function () { 306 doPause(that); 307 that.isPlay = true; 308 }*/ 309 310 if (that.first && that.$toTime < 5) { 311 setTimeout(function () { 312 that 313 .audio 314 .play(); 315 }, 300); 316 } else { 317 that 318 .audio 319 .play(); 320 } 321 that.first = false; 322 } else { 323 that 324 .t 325 .resume(that.pauseTime); 326 that 327 .audio 328 .play(); 329 } 330 doPlay(that); 331 } else { 332 doPause(that); 333 } 334 this.isPlay = !this.isPlay; 335 // æå 336 var obj = $this.parents('.audioItem'); 337 btmPlay(obj); 338 }) 339 }); 340} 341 342var videoPlay= $(".video-list"); 343var videoLength = $(".video-list").length; 344var DEFAULT_VERSION = 8; 345var ua = navigator.userAgent.toLowerCase(); 346var isIE = ua.indexOf("msie")>-1; 347var safariVersion; 348if(isIE){ 349 safariVersion = ua.match(/msie ([\d.]+)/)[1]; 350 var sa = parseInt(safariVersion); 351 if(safariVersion <= DEFAULT_VERSION ){ 352 videoPlay.find("video").show(); 353 }else{ 354 //alert("ie8以ä¸") 355 useVideoList(videoPlay); 356 } 357}else{ 358 useVideoList(videoPlay); 359} 360function useVideoList(videoList){ 361 // videoList.hover(function() { 362 // if($(this).find("video").attr('src') == 'æªç¥'){ 363 364 // } else { 365 // $(this).find("video").attr("loop", "loop"); 366 // $(this).find("img").hide().siblings("video").show(); 367 // if ($(this).find("video").length > 0) { 368 // $(this).find("video").get(0).play(); 369 // } 370 // } 371 // }, function() { 372 // $(this).find("img").show().siblings("video").hide(); 373 // if ($(this).find("video").length > 0) { 374 // $(this).find("video").get(0).pause(); 375 // } 376 // }); 377var palyT ; 378 379$('body').on('mouseenter','.video-list',function(event){ 380 var that = $(this); 381 palyT = setTimeout(function(){ 382 if (that.find("video").attr('src') == 'æªç¥'&&!that.find("video").attr('data-src')) { 383 return; 384 } else { 385 that.find("video").attr("loop", "loop"); 386 that.find("img").hide().siblings("video").show(); 387 if (that.find("video").length > 0) { 388 //that.find("video").get(0).pause(); 389 390 if(!that.find("video").attr('src')||that.find("video").attr('src')==''){ 391 var source = that.find("video").attr('data-src'); 392 that.find("video").attr('src',source); 393 } 394 395 that.find("video").get(0).play(); 396 } 397 } 398 },200);
399}); 400$('body').on('mouseleave','.video-list',function(event){ 401 $(this).find("img").show().siblings("video").hide(); 402 if ($(this).find("video").length > 0) { 403 $(this).find("video").get(0).pause(); 404 window.clearTimeout(palyT); 405 } 406 window.clearTimeout(palyT); 407}) 408} 409function videoLoding(that){ 410 var imgUrl=that.attr('imgUrl'); 411 if(imgUrl==0){ 412 return false; 413 } else { 414 that.attr('poster', imgUrl); 415 that.attr('imgUrl', '0'); 416 } 417} 418 419$(window).on('load', function () { 420 $(".img-box img.lazy").css("background", "none"); 421});
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.