troubleshooting Question

Randomize Images Location

Avatar of jay_eire
jay_eireFlag for United States of America asked on
JavaScript
2 Comments1 Solution784 ViewsLast Modified:
Hi Guys,
I have table on a web page that is displaying 7 different images, what I need to do is to somehow randomize the position of where each image is displayed within the table each time the page loads so that there is not one preference.
I need the 7 images to appear on the page at all times, I've had a scout around the web for a script but haven't found one that displays the 7 seven images each time.

here's my code so far.......

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Randomize Images Location</title>
<style type="text/css">
<!--
.style1 {
      font-family: Verdana, Arial, Helvetica, sans-serif;
      font-size: 12px;
      font-weight: bold;
}
-->
</style>
</head>

<body>
<p class="style1">Randomize Images Location</p>
<table width="600" border="1">
  <tr>
    <th scope="col"><a href="http://www.google.com"><img src="Image1.jpg" width="120" height="92" border="0" /></a></th>
    <th scope="col"><a href="http://images.google.com/imghp?hl=en&tab=wi"><img src="Image2.jpg" width="120" height="92" border="0" /></a></th>
    <th scope="col"><a href="http://video.google.com/?hl=en&tab=iv"><img src="Image3.jpg" width="120" height="92" border="0" /></a></th>
    <th scope="col"><a href="http://news.google.com/nwshp?tab=vn&hl=en"><img src="Image4.jpg" width="120" height="92" border="0" /></a></th>
    <th scope="col"><a href="http://maps.google.com/maps?tab=nl&hl=en"><img src="Image5.jpg" width="120" height="92" border="0" /></a></th>
    <th scope="col"><a href="http://mail.google.com/mail/?tab=lm"><img src="Image6.jpg" width="120" height="92" border="0" /></a></th>
    <th scope="col"><img src="Image7.jpg" width="120" height="92" /></th>
  </tr>
</table>
<p>&nbsp; </p>
</body>

</html>

 

Ive found this script but its not entirely working as some images end up repeating themselves.
http://www.re-vision.com/webwork/22_javascript/random-images/randomreload.html

Thanks
Jay Eire
ASKER CERTIFIED SOLUTION
basicinstinct

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros