$(function(){
$(document).delegate('.audio_btn','click',playRadio)
});
//playRadio的实现
function playRadio(){
//toggle事件处理
$(this).toggle(function(i){
playVoice(this);
},
function(i){
pauseVoice(this);
});
$(this).trigger('click');
}
//playVoice和pauseVoice实现
//播放
function playVoice(_this){
$(".audio_btn").addClass("audio_btn_on");
var rd=document.getElementById("radios");
if(document.all)
rd.play();
else
document.getElementById("photo_audio").play();
}
//暂停
function pauseVoice(_this){
$(".audio_btn").removeClass("audio_btn_on");
var rd=document.getElementById("radios");
if(document.all)
rd.stop();
else
document.getElementById("photo_audio").pause();
}
其中document.all是判断是否是IE浏览器