jQuery可以在youtube / vimeo电影上收听点击事件吗? [英] Can jQuery listen to a click event on a youtube / vimeo movie?

查看:108
本文介绍了jQuery可以在youtube / vimeo电影上收听点击事件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个充满电影的jQuery滑块,我希望jQuery在嵌入/对象的点击事件上停止滑块。我试图让这个工作无济于事。我试过这个:

I have a jQuery slider filled with movies and I would like jQuery to stop the slider on a click event for either the embed / object. I have tried to no avail to get this to work. I have tried this:

$("embed").click(function() {
alert('Handler for .click() called.');   
})

$("object").click(function() {
alert('Handler for .click() called.');   
})

既不适用于HTML标签嵌入或对象。有什么建议吗?

Neither works for the HTML tags embed or object. Any suggestions?

推荐答案

像这样启用youtube播放器:

Enable the youtube player like so:

http://www.youtube.com/v/VIDEO_ID?enablejsapi=1& ; version = 3

然后您可以使用这些操作并听取并对onStateChange等事件作出反应

Then you can use these operations and listen to and react to events such as "onStateChange"

这篇关于jQuery可以在youtube / vimeo电影上收听点击事件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆