/    Sign up×
Community /Pin to ProfileBookmark

Weird script – displaying pic…

This is a bit of a weird script request but i am just play arond with some ideas.
I need the code to do the following:

  • randomly selects a picture from a list of pictures with unique values (e.g. a, b,c…)

  • Displays the picture in a div tag after ‘x’seconds, displays the picture for ‘x’seconds, then displays it after ‘x’seconds again, displays the picture for ‘x’seconds.
    -Then on click submit button print the value of the picture selected.
  • Thanks for any help

    to post a comment
    JavaScript

    4 Comments(s)

    Copy linkTweet thisAlerts:
    @james_d_kellyauthorAug 27.2005 — To make things simpler how would i do the following:

    -Display a ramdom pic in a div tag after 'x'seconds, for 'x'seconds

    Thanks...
    Copy linkTweet thisAlerts:
    @cyber1Aug 27.2005 — Would it possible to post what you've got so far?

    An example page link or something?

    -Bill
    Copy linkTweet thisAlerts:
    @james_d_kellyauthorAug 27.2005 — Ive got the random image script to work and displaya random pic but dont know how to icncorperate multiple TimeOut functions to the displayed pic


    <SCRIPT LANGUAGE="Javascript">

    function image() {

    };

    image = new image();

    number = 0;

    // imageArray

    image[number++] = "<p align=center><img src='pic1' value='vpic1'>"

    image[number++] = "<p align=center><img src='pic2' value='vpic2'>"

    image[number++] = "<p align=center><img src='pic3' value='vpic3'>"

    image[number++] = "<p align=center><img src='pic4' value='vpc4'>"

    image[number++] = "<p align=center><img src='pic5' value='vpic5'>"

    image[number++] = "<p align=center><img src='pic6' value='vpic6'>"


    increment = Math.floor(Math.random() * number);

    document.write(image[increment]);

    </SCRIPT>
    Copy linkTweet thisAlerts:
    @cyber1Aug 27.2005 — What I would do is use a slideshow script and see if you can modify it to do the extra stop and start that you want.

    Heres one, even has a tutorial:

    [URL=http://www.trans4mind.com/personal_development/JavaScript/imageSlideShow.htm]http://www.trans4mind.com/personal_development/JavaScript/imageSlideShow.htm[/URL]

    If you can add a delay and then start again, the other part should be easy.

    -Bill
    ×

    Success!

    Help @james_d_kelly spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 4.23,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...