The page shows 2 large pictures of a product. There are 3 different colours to this product which all have images. at present there are 3 small thumbnails which when you hover over change the large images to be the ones of corresponding colours.
This works lovely but what i would like to do as there will be other products added to the range is use the samepage for all the products.
I would like to create a string which is inserted into my javascript function for the images that pertain to the product in question.
I have created the string and inserted it into the javascript but the images are not showing.
Creating the string:
Code: Select all
$string = "";
while ($row = mysql_fetch_assoc($resultID))
{
$test = "'designerscarfs/".$row['ProductCode'].".jpg' ,";
$string = $string.$test;
}Code: Select all
$length = strlen($string)-1;
//set a variable to only show the string to the length determined above.
$preload = substr($string, '0', $length);Code: Select all
var srcs = [<?PHP $preload ?>];Thanks in anticipation
Nuts