php image gallery (slider)

Started by Natzu01, June 12, 2016, 02:49:44 AM

Previous topic - Next topic

Natzu01

hello friends smf I have three points in consultation are, add a description in the bottom left, then put a frame that is centered at imaguenes, then add a sort button to move and you go back in the izqiera right and for forward motion the imaguenes,and if possible that you recommend putting styles, Thanks.

I attached my codes



$images = array(
'image1_url',
'image2_url',
'image3_url',
'image4_url',
);
$links = array(
'image1_link',
'image2_link',
'image3_link',
'image4_link',
);

$delay = 1;

$num_images = count($images);
echo '
<a id="slideshowa" href=""><img id="slideshowimg" src="" alt="" /></a>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var images = [';

for ($i = 0; $i < $num_images; $i++)
echo '["', $images[$i], '"]', ($i == $num_images - 1) ? '' : ',';

echo '];
var links = [';

for ($i = 0; $i < $num_images; $i++)
echo '["', $links[$i], '"]', ($i == $num_images - 1) ? '' : ',';

echo '];
var current_image = 0;
var num_images = ', $num_images, ';
var timer;

function changeImage()
{
if (current_image == num_images)
current_image = 0;
document.getElementById("slideshowimg").src = images[current_image];
document.getElementById("slideshowa").href = links[current_image];
current_image = current_image + 1;
var timer = setTimeout("changeImage();", ', $delay * 1000, ');
}

changeImage();
// ]]></script>';


Advertisement: