且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

单击后退按钮时如何停止播放功能

更新时间:2023-09-23 07:53:57

你可以添加监听器到后退按钮和编写处理后退按钮事件的代码ex:



  document  .addEventListener (  backbutton function (e ){
这里写代码来处理后退按钮
}, false );







这是phonegap设备API所以添加cordova / phonegap JS并在设备下添加此代码准备



http://docs.phonegap.com/en/2.9.0/cordova_events_events.md.html#后退按钮 [ ^ 一>


hi i doing a function under play/pause using href ..
my problm is when i press play it plays.. even if i again press the same button it pauses..
problm was when i click back button it not pausing.. it plays continuously .. may i know why... kindly explain me with code.....



thanks in advance

hi you can add listener to back button and write code to handle back button event ex:

document.addEventListener("backbutton", function(e){
   write code here to handle back button
}, false);




This is phonegap device API so add cordova/phonegap JS and add this code under device on ready

http://docs.phonegap.com/en/2.9.0/cordova_events_events.md.html#backbutton[^]