Random Picture [HTML HELP!!]

Discussion in 'HTML & Website Design' started by AnimeFevers, May 30, 2009.

  1. #1
    Hi, I was wondering if there was a html code where you can put a selection of pictures into it, and each time someone navigates to a differnt page on your site a random picture is shown.
     
    AnimeFevers, May 30, 2009 IP
  2. NathanCH

    NathanCH Well-Known Member

    Messages:
    806
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #2
    NathanCH, May 30, 2009 IP
  3. thoriphes

    thoriphes Guest

    Messages:
    313
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you can make it it PHP very easily here is the trick .

    name your pic 1.jpeg,2.jpeg .... n.jpeg

    create a PHP code using the Rand(1,n) function , it will generate a random number . Use that and append .jpeg and you can display random image very easily .
     
    thoriphes, May 30, 2009 IP
  4. SA101

    SA101 Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    PHP would be better.
     
    SA101, May 30, 2009 IP
  5. Hostm2

    Hostm2 Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Use ajax/js ;)
     
    Hostm2, May 30, 2009 IP
  6. AnimeFevers

    AnimeFevers Well-Known Member

    Messages:
    1,013
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    130
    #6
    Whats that...?

    A little more info please :)
     
    AnimeFevers, May 30, 2009 IP
  7. Hostm2

    Hostm2 Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    var quotes = new Array;
    
    quotes.push("1");
    
    quotes.push("2");
    
    quotes.push("3");
    
    document.write(quotes[(Math.floor(Math.random() * quotes.length))]);
    Code (markup):

    here... use this js..
     
    Hostm2, May 30, 2009 IP