0
當div的x位置值超過50時,我想播放聲音。我用箭頭鍵控制div。jquery sound not playing
http://jsfiddle.net/vvccvvcc/f9fsnLcu/3/
我猜audioElement.play()
不工作。
無論是聲音還是警報彈出(函數playSound)下面
當div的x位置值超過50時,我想播放聲音。我用箭頭鍵控制div。jquery sound not playing
http://jsfiddle.net/vvccvvcc/f9fsnLcu/3/
我猜audioElement.play()
不工作。
無論是聲音還是警報彈出(函數playSound)下面
固定碼 http://jsfiddle.net/f9fsnLcu/4/
First your sound handle was out of scope, so i defined it in window:
window.audioElement = audioElement = blabla
Second you were trying to compare object with a number. Don't need to wrap x.left in jquery.
if (x.left>50)