单击图像,删除图像并使用jquery自动启动youtube

时间:2014-02-06 18:31:25

标签: php jquery

我的代码从youtube获取所需的所有数据,生成图像预览并显示它。这是我的代码并成功运作:

<?php
  

$row['comment'] = preg_replace("/\s*[a-zA-Z\/\/:\.]*youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", "</br><table style='border:1px solid lightgrey;'><td bgcolor='#EBEBEB' style='vertical-align:top;'><div id='container'><div id='img1'><img src='http://img.youtube.com/vi/$1/default.jpg' title='YouTube Video' alt='YouTube Video'/></div><div id='img2'><img src='img/play-button.png'/></div></div></td><td width='370px;' bgcolor='#EBEBEB' style='vertical-align:top;'><font color='#363636'><b>$video_title</b></font><font color='#545454'></br><a href='http://www.youtube.com/watch?v={$id}' target='_blank'><font color='#69aa35'><b>Youtube.com</b></font></a> - $video_perigrafh...</font><font color='#949494'>[$view_count views]</font></td></table>", $row['comment']);

?>

任何想法如何添加链接到预览图像,它将删除预览图像并自动启动YouTube视频?我该如何使用jquery?

0 个答案:

没有答案