我需要将一个有效的jQuery脚本迁移到Mootools以满足我的项目要求。
工作的jquery代码是:
$('#video').bind('ended', function() {
//Functions on end here.
});
我在Mootools上尝试了以下内容......
document.id('video').addEvent('ended', function () {
//Functions here
});
和
document.id('video').addEvent('ended', function () {
//Functions here
}.bind(this));
但是没有效果:(任何人都能指出正确的方向吗?
谢谢!
答案 0 :(得分:1)
MooTools不支持HTML5媒体标记事件。添加块written here后,您可以使用:
$('myVideo').addEvent('ended', function(){
//Functions here
});
此处 myVideo 是标记的ID:
<video id="myVideo"></video>