$(a).hover(function(){ var audio = $('<audio>', { autoPlay : 'autoplay', controls : 'controls' }); var fileFormat = "mp3"; var canPlayMP3 = (typeof audio.canPlayType === "function" && audio.canPlayType("audio/mpeg") !== ""); if (!canPlayMP3) { fileFormat = "ogg"; } if(fileFormat == "mp3"){ addSource(audio, 'audio/ding.mp3'); } else{ addSource(audio, 'audio/ding.ogg'); } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)