I have a slider on a website. The slider is called anything slider.
You can view it on the link below:
http://css-tricks.com/examples/AnythingSlider/#&panel1-1
The slider allows for youtube videos to be embedded.
however at current I have a php look that is looping through a directory to show any banner images that are uploaded into this directory.
I am unsure of how to add a youtube link as one of the sliders but still keeping the loop through the directory.
Here is the code I am using:
<ul id="slider">
<?php
if ($handle = opendir('public/slider/'))
{
while (false !== ($file = readdir($handle)))
{
$files[] = $file;
}
$files = array_slice($files, 2);
foreach ($files as $file)
{
$name = explode('.', $file);
print '<li><img src="public/slider/'.$file.'" title="'.$name[0].'" /></li>';
}
closedir($handle);
}
?>
Any suggestions on how I can do this?
Thanks
Try this: