Jump to content

www.cardsunlimited.com - feedback wanted!


marmite

Recommended Posts

Thanks both... yes, the homepage image rotation needs attention but I confess I don't know anything about javascript so it was a struggle just getting to that bit. I see istockphoto.com has a random selector and might have a look at how they did it.

 

What do you mean, "search feature outside of each category" ? Do you mean it would be better to be able to search on both dropdowns at once?

 

Thanks for your feedback :)

The site looks great.

 

FYI....you can do the image rotation with PHP.

 

<?php

$img_array = array('add','arrow','book','cancel','contact');
$random_img = $img_array[rand(0, count($img_array) - 1)];
echo '<img src="images/'.$random_img.'.gif" class="noBorder" alt="Random Image"/>';

?>

 

per the above code, you'd have to have images named "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg" in your "images" directory.  You can add more or remove some, just make sure that the list in array matches the images that you have in your "images" directory

You could even make it more dynamic so it read the files in the directory and chose a random one....

 

This could get resource intensive causing delays, but you could catalog the files or surely theres some way to just count files in a folder, thus allowing you to select a random number < the amount of pictures.

In the code I put above, I used .gif in the code, but told you to use .jpg in the explanation.  Just change the one line to the red below.

 

echo '<img src="images/'.$random_img.'.jpg" class="noBorder" alt="Random Image"/>';

 

corbin's suggestion would be ideal, since you'd be able to just add a new image or remove an image whenever you wanted without having to change the array values.  I went for the simpler (coding wise) approach, because I'm lazy.  ;D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.