From 6a6d33efa631f01a4d161733226e01a42fc273a2 Mon Sep 17 00:00:00 2001 From: 王晓刚 <wxg@bronet.cn> Date: Tue, 5 Nov 2019 15:13:56 +0800 Subject: [PATCH] 音频 --- application/home/view/goods/audio_detail.html | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/application/home/view/goods/audio_detail.html b/application/home/view/goods/audio_detail.html index 81ca46d..749b750 100644 --- a/application/home/view/goods/audio_detail.html +++ b/application/home/view/goods/audio_detail.html @@ -193,16 +193,15 @@ }); var over = []; $(".audio_style").click(function() { - var audioTimer = []; var index = $('.audio_style').index(this); $(audio).each(function (key, vo) { - audioTimer[key] = "audioTimer"+key; if(key == index){ if(vo.currentTime == 0 || vo.currentTime == vo.duration){ - console.log(audioTimer[key]+"开始"); + console.log("开始"); + audio.eq(key).parents('.detail_audio_wrap').find(".b3").siblings().removeClass("b_stop"); vo.play(); var audioTime = parseInt(vo.duration); - audioTimer[key] = setInterval(function() { + var audioTimer = setInterval(function() { audioTime--; console.log(audioTime) if (audioTime % 2 == 0) { @@ -224,16 +223,15 @@ } audioTime = parseInt(vo.duration); audio.eq(key).parents('.detail_audio_wrap').find(".b3").siblings().removeClass("b_active"); - clearInterval(audioTimer[key]); + clearInterval(audioTimer); } }, 1000); }else{ - console.log(audioTimer[key]+"暂停"); + console.log("暂停"); vo.currentTime = 0; vo.pause(); // clearInterval(eval(audioTimer[key])); audio.eq(key).parents('.detail_audio_wrap').find(".b3").siblings().addClass("b_stop"); - console.log("???") /*var highestIntervalId = setInterval(";"); console.log(highestIntervalId); for (var i = 0 ; i < highestIntervalId ; i++) { @@ -243,7 +241,8 @@ }else{ vo.currentTime = 0; vo.pause(); - clearInterval(audioTimer[key]) + audio.eq(key).parents('.detail_audio_wrap').find(".b3").siblings().addClass("b_stop"); + // clearInterval(audioTimer[key]) // var highestIntervalId = setInterval(";"); // for (var i = 0 ; i < highestIntervalId ; i++) { // clearInterval(i); -- libgit2 0.24.0