开发者

Clickable video embedded with JS

H开发者_如何学Goow do I make it so when I have an embed code for a video, if they click the video it goes to another page? but doesn't mess with the controls of the video itself?

Thanks!


Usually, the "link" the video goes to is actually controlled by the flash movie that plays the video. If you use HTML5 video, you can control it better with usual JS event listeners, but it's not supported everywhere.

Alternatively, you can put an absolutely positioned transparent image over the video part of the player, and use JS (or an tag) to turn it into a link to elsewhere, while leaving the controls uncovered. I would test this thoroughly, and it may not work as expected on older IE versions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜