My code below.. I will appreciate all the replies, suggestions and advice.
<script>
var imageUrl = new Array();
var imageTitle = new Array();
var imageCaption = new Array();
<?php
for($counta=0; $counta<$count; $counta++)
{
echo "imageTitle[".$counta."]=\"".$imageTitle[$counta]."\";";
echo "imageUrl[".$counta."]=\"".$imageURI[$counta]."\";";
echo "imageCaption[".$counta."]=\"".$imageCaption[$counta]."\";";
}
?>
jQuery.noConflict();
jQuery(document).ready(function() {
var a=0;
function changepicture() {
jQuery("#slideshowpicture img").attr('src', imageUrl[a]);
jQuery("#slideshowtitle").html(imageTitle[a]);
jQuery("#slideshowarticle").html(imageCaption[a]);
jQuery(".dot"+a).attr('src', "<?php echo $templateuri; ?>/images/home/dotw.jpg");
if( a == 0) {
a++;
jQuery(".dot<?php echo $count-1; ?>").attr('src', "<?php echo $templateuri; ?>/images/home/dotb.jpg");
}
else if( a == <?php echo $count-1; ?>) {
b = a - 1;
a = 0;
jQuery(".dot"+b).attr('src', "<?php echo $templateuri; ?>/images/home/dotb.jpg");
}
else {
b=a-1;
a++;
jQuery(".dot"+b).attr('src', "<?php echo $templateuri; ?>/images/home/dotb.jpg");
}
}
changepicture();
var slideinterval = setInterval(changepicture, 4000);
});
</script>