通过简要查看ContextJS文档,您要做的第一件事就是对其进行初始化。
// these are all the defaults
context.init({
fadeSpeed: 100,
filter: null,
above: 'auto',
preventDoubleContext: true,
compress: false
});
现在,您可以使用来在其他项目上启用上下文菜单context.attach(selector, menuObjects
。
似乎video.js
将类应用于video-js
它制作的所有视频播放器容器。因此,您可以通过执行以下操作将上下文菜单添加到屏幕上的每个视频:
context.attach('.video-js', [
{text: 'play', action: function(){ /* code */ }},
{text: 'help', href: '/help.html'}
]);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句