admin管理员组文章数量:1357672
I want to add video into my website. But I want to play that video within pop up window when user click on image. How can I do that.??
I want to create that look like this website. /
Thanxx :)
I want to add video into my website. But I want to play that video within pop up window when user click on image. How can I do that.??
I want to create that look like this website. https://www.shoplocket./
Thanxx :)
Share Improve this question asked Sep 20, 2012 at 7:57 Shashika NanayakkaraShashika Nanayakkara 11 gold badge1 silver badge1 bronze badge 04 Answers
Reset to default 1You could use colorbox
see here for example
Well first of all you should know what kind of popup you want. Just a new screen or a nice effect like the website you provided.
In the last case you could look at some popular popup possibilities like lightbox, fancybox,... Depending on the plugin you choose, you'll have to check their documentation to embed video's.
Good luck!
Use PrettyPhoto.
Check out the Vimeo Content in it.
To open Vimeo content with it simply:
- Create a link (<a href="#"></a>).
- Add the rel attribute “prettyPhoto” to it (rel=”prettyPhoto”).
- Change the href of your link so it points to the Vimeo video page, the same link you would share with friends.
Code:
<a href="http://www.youtube./watch?v=qqXi8WmQ_WM" rel="prettyPhoto" title=""><img src="images/thumbnails/flash-logo.jpg" alt="YouTube" width="60" /></a>
To play a video put it as content of a popup
<video id="videoPop" class="video" controls >
<source src="adress">
</video>
This is popup itself:
HTML:
<div class="popup" onclick="myFunction()">Click me!
<span class="popuptext" id="myPopup">Popup text...</span>
</div>
JS:
<script>
// When the user clicks on <div>, open the popup
function myFunction() {
var popup = document.getElementById('myPopup');
popup.classList.toggle('show');
}
</script>
When I write this the website you mentioned does not work, so I live CSS for you.
No you need HTML trigger:
<div class="popup" onclick="myFunction()">Click me to toggle the popup!
<span class="popuptext" id="myPopup">A Simple Popup!</span>
</div>
本文标签: javascriptHow to add vimeo player into pop up window when it clck on ImageStack Overflow
版权声明:本文标题:javascript - How to add vimeo player into pop up window when it clck on Image..??? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744080580a2587561.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论