dongyou4411
2016-01-19 18:05点击时使用jQuery或Javascript更改变量值
I have a page with a table of video links (think playlist) that each contain a vimeo id. I also have an HTML5 player that is optimized for Vimeo videos and I simply need to change the ID upon clicking on a selected video.
My code is as follows:
Video Player:
<?php
<iframe width="100%" height="520" frameborder="0" allowfullscreen="" mozallowfullscreen="" webkitallowfullscreen="" src="//player.vimeo.com/video/[ID-GOES-HERE]" id="myvideo"></iframe>
?>
My table is as follows:
<table width="100%">
<tbody>
<tr>
<td valign="middle" class="media"><p><a href="#"><i class="fa fa-play-circle-o"></i></a></p></td>
<td valign="middle" class="name"><p>Christmas Chapel<span>Dr William M Wilson</span></p></td>
<td valign="middle" class="info"><p>Special Christmas Chapel</p></td>
<td valign="middle" class="day"><p>December 02, 2015</p></td>
</tr>
<tr>
<td valign="middle" class="media"><p><a href="#"><i class="fa fa-play-circle-o"></i></a></p></td>
<td valign="middle" class="name"><p>Christmas Chapel<span>Dr William M Wilson</span></p></td>
<td valign="middle" class="info"><p>Special Christmas Chapel</p></td>
<td valign="middle" class="day"><p>December 01, 2015</p></td>
</tr>
</tbody>
</table>
I would like to have it so that when anyone clicks on the "a" tag for Dec 2nd it pushes that videos vimeo id into the player and starts autoplaying the video. It would also need to override the Dec 2nd value with Dec 1st if I click on that.
What is the best way of doing this?
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- jQuery中Ajax非异步请求回调函数内修改全局变量的问题
- html5
- ajax
- javascript
- jquery
- 1个回答
- jQuery - 输入值更改时更新变量
- javascript
- php
- jquery
- 2个回答
- 点击时使用jQuery或Javascript更改变量值
- javascript
- php
- jquery
- 1个回答
- 使用ajax(相同页面)从jquery值更改php变量[关闭]
- ajax
- php
- jquery
- 1个回答
- bootstraptable-edit使用问题
- html5
- javascript
- 1个回答
换一换