1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Random Image

Discussion in 'HTML & JavaScript' started by Dove1992, Apr 19, 2014.

  1. Dove1992

    Dove1992 Newbie

    Joined:
    Apr 19, 2014
    Messages:
    21
    Likes Received:
    1
    Hello there.

    I'd like to create a website looking as the following (see attachment).

    I already found out that you can put a link on a picture like this:

    <a href="link.html"><img src="picture.jpg" alt="my picture" /></a>

    But I don't know how to implement the rest.

    If it is too difficult for a beginner, maybe someone could write the script for me?

    Looking forward for help.

    Regards.
     

    Attached Files:

  2. kosher_12

    kosher_12 Newbie

    Joined:
    Aug 9, 2011
    Messages:
    25
    Likes Received:
    11
    In what platform you will be implementing this thing?

    You probably need a combination of PHP and jquery, but it will depend whether you are using a CMS, plain HTML or Custom PHP website
     
  3. Dove1992

    Dove1992 Newbie

    Joined:
    Apr 19, 2014
    Messages:
    21
    Likes Received:
    1
    If I open my public_html folder then I can open a HTML Editor.

    But there are also possibilities to use PHP I think.

    Is it doable, if yes, how?
     
  4. azerty1590

    azerty1590 Newbie

    Joined:
    Sep 1, 2013
    Messages:
    2
    Likes Received:
    0
    Here it is, with a simple json list :)
    check jsfiddle with the URL below, can't post full link
    /fR7yU/4/
     
    Last edited: Apr 24, 2014
  5. Quebeck

    Quebeck Newbie

    Joined:
    Jun 29, 2013
    Messages:
    11
    Likes Received:
    2
    I would suggest Javascript because you can load the images on page means without refresh the site.
    Practically you import the images and the corresponding links from a database or file into a JS array. Tuple or json format recommended.
    You write a little function with picks a random image/link and inserts it into the HTML tags.

    Thats it. I've google it and get tons of already finished scripts which do exactly what you try to do.
     
  6. Dove1992

    Dove1992 Newbie

    Joined:
    Apr 19, 2014
    Messages:
    21
    Likes Received:
    1
    Thank you guys very much :)