html5 audio player - jquery toggle click play/pause?

前端 未结 15 2477
南笙
南笙 2020-11-28 06:24

i wonder what i\'m doing wrong?

    $(\'.player_audio\').click(function() {
    if ($(\'.player_audio\').paused == false) {
        $(\'.player_audio\').paus         


        
15条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 06:41

    This thread was quite helpful. The jQuery selector need to be told which of the selected elements the following code applies to. The easiest way is to append a

        [0]
    

    such as

        $(".test")[0].play();
    

提交回复
热议问题