单击图像时,将图像与嵌入式vimeo视频交换 [英] swap image with embedded vimeo video when image is clicked

查看:102
本文介绍了单击图像时,将图像与嵌入式vimeo视频交换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一段时间以来,我一直在寻找解决方案,但我不是jquery专家.

i've been looking for a solution to this for a while, but i'm no jquery expert.

我目前在页面上有一个嵌入式vimeo视频.我希望页面加载时隐藏视频,并在其中放置图像.当用户单击该图像时,该图像将被隐藏,并且视频将在同一位置开始播放.

i currently have an embedded vimeo video on a page. i want the page to load with the video hidden and an image in it's place. when the user clicks the image, the image is hidden and the video begins to play in the same spot.

我在这里看到了一些有关youtube视频的类似操作,但是我不确定vimeo是否以相同的方式工作.

i saw something on here about doing a similar thing with youtube videos, but i'm not sure if vimeo works the same way or not.

我还尝试了一些jquery方法(例如replaceWith),但它们无法正常工作.

i also tried some jquery methods like replaceWith but they were not working properly.

我们将不胜感激.

推荐答案

为什么不将视频与页面的其余部分一起加载到隐藏的div中,然后使用.show()?

Why not load the video into a hidden div along with the rest of the page, and then use .show()?

这篇关于单击图像时,将图像与嵌入式vimeo视频交换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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