Soldato
- Joined
- 26 Aug 2012
- Posts
- 4,449
- Location
- North West
Hi,
I have a PHP loop that prints out a table, with two columns, first column is the title of a video and the second one is a thumbnail of that video.
For each of the thumbnails, I have added a JavaScript function which onclick opens that video in a new window.
For some reason it works fine for all the videos except the first one. I print two of these tables out, one on the left and one on the right of the page. For the second table all elements including the first work as expected.
Code below and any help would be more appreciated.
I have a PHP loop that prints out a table, with two columns, first column is the title of a video and the second one is a thumbnail of that video.
For each of the thumbnails, I have added a JavaScript function which onclick opens that video in a new window.
For some reason it works fine for all the videos except the first one. I print two of these tables out, one on the left and one on the right of the page. For the second table all elements including the first work as expected.
Code below and any help would be more appreciated.
Code:
<!-- On click Function-->
<script type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
PHP:
for($video_counter=0;$video_counter<=$loop1_counter;$video_counter++)
{
echo <<< HTML
<tr>
<td>$file_name[$video_counter]</td>
<td><img src="$thumbnail_path[$video_counter]" height="100" width="120" onclick="MM_openBrWindow('$video_path','$file_name[$video_counter]','width=650,height=500'); return false;"></td>
</tr>
HTML;
}