Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 07:16:24 PM

Pages: [1]   Go Down
  Print  
Author Topic: Ways to show images on a html page randomly  (Read 641 times)
Bluelight
Jedi
*****
Offline Offline

Posts: 836


« on: August 24, 2001, 04:28:00 PM »

Is there a way besides gifs to show images randomly (if thats the word?)I would like it to be like if you come to my startpage there will be pic a and if you come back for example 1 hours later you`ll get pic b.
  Is there a solution for this.
 
  Blue
 
Logged
Ice
Galactic Royalty
*****
Offline Offline

Posts: 259


WWW
« Reply #1 on: August 24, 2001, 08:59:00 AM »

Most definitely  

Though you'll actually need to use JS.  
Here are some links that might help you.

Random Image Link
Day-of-the-week image displayer
Random Image(out of 3)
Different Image(morning or night)

I'm sure there's more out there.   Just do a search for random images or similar.

Hope that helps  
Logged

Flipside Gin
A site for Cases ladder gin players at Flipside.com
 http://www.lunarpages.com/fsgin
Shadowcrafter
Galactic Royalty
*****
Offline Offline

Posts: 323


WWW
« Reply #2 on: August 24, 2001, 10:50:00 AM »

http://kickme.to/ronnyb

bellow is what does what you ask,on my page.
its from macromedia so i dont know if it'll work for you or not(it include a small table)
Shadow


<table width="75%" align="center" height="82">
  <tr>
    <td height="86">
      <div align="center">
        <script language="JavaScript">
  var j,l="",m="",p="",q="",z="",list= new Array()
  list[list.length]='dvd12cr.gif';
  list[list.length]='cshq45.gif';
  list[list.length]='cdrw121032cr.jpg';
  j=parseInt(Math.random()*list.length);
  j=(isNaN(j))?0:j;
  if (list[j].indexOf('?')==-1) {
    document.write("<img src='"+list[j]+"'>");
  }
  else {
    nvp=list[j].substring(list[j].indexOf('?')+2).split('&');
    for(var i=0;i<nvp.length;i++) {
      sub=nvp.split('=');
        switch(sub[0]) {
        case 'link':
          l="<a href='"+unescape(sub[1])+"'>";
          p="</a>";
        break;
       case 'target':
          q=" target='"+unescape(sub[1])+"'";
          break;
         default:
          m+=" "+sub[0]+"='"+unescape(sub[1])+"'";
          break;
      }
    }
    z=(l!="")?((q!="")?l.substring(0,l.length-1)+q+">":l):"";
    z+="<img src='"+list[j].substring(0,list[j].indexOf('?'))+"'"+m+">"+p;
  document.write(z);
  }
</script>
      </div>
    </td>
  </tr>
</table>
Logged

I can't but help to darken
your doorstep, I'm a Shadow.
Bluelight
Jedi
*****
Offline Offline

Posts: 836


« Reply #3 on: August 25, 2001, 02:50:00 AM »

Thanks i`ll try both these solutions they will certainley work both in some way or another.Tell you when it`s done.

   Ice you amaze me.Always there.
   You should have 10 free big fat accounts in here for your work. He he...

   Blue.

  Ps I´ll start out with the code from Shadow that will be the most tricky to do i guess  as i know nothing about Html but i managed to fix something similar just with code given to me.Had to fool around awhile but finally it worked.Fun!
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: