Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default Switch Images

    Where can I find the script which switches images upon page refresh?

    Or, what is tha name of this particular script?

    I looked on Dynamic Drive but didn't see anything or I just don't know what
    it's called.

    Thanks!

    Text:beer;;)

    kelly @ herco Guest

  2. Similar Questions and Discussions

    1. Trouble with -T switch
      Hi everybody, I'm having trouble with setting the path to my sendmail program when using the -T switch. It's a simple script that creates a from,...
    2. Switch to 12" G4 - ?'s
      I am looking for an ultraportable to do powerpoint and word on, and take on the road for presentations, It must work flawlessly with my desktop...
    3. Trying to use a here doc within a switch
      I'm trying to use here docs within a switch to output html. The code below works (i.e. prints a Foo1 headline below my tab graphic) but if I take...
    4. Computer won't switch on
      Hi -- I have a 7013-595 running AIX 5.1. It doesn't get used very often; the last time I used it was almost a month ago. Back then, it worked...
    5. Switch Versions
      How do i chnage in MX from MX to 4 and visa versa?
  3. #2

    Default Switch Images

    Where can I find the script which switches images upon page refresh?

    Or, what is tha name of this particular script?

    I looked on Dynamic Drive but didn't see anything or I just don't know what
    it's called.

    Thanks!

    Text:beer;;):confused;

    kelly @ herco Guest

  4. #3

    Default Re: Switch Images

    Here's the javascript code you would need to do what you want to do:

    <script language="JavaScript" type="text/javascript">
    <!--
    var quote = new Array(
    "<img src=\'images/pic1.gif\' alt=\'picture\'>",
    "<img src=\'images/pic2.gif\' alt=\'picture\'>",
    "<img src=\'images/pic3.gif\' alt=\'picture\'>",
    "<img src=\'images/pic4.gif\' alt=\'picture\'>",
    "<img src=\'images/pic5.gif\' alt=\'picture\'>"
    );
    document.write(quote[Math.floor(Math.random()*quote.length)]);
    // -->
    </script>

    A couple of things to keep in mind. No comma after the last image. Any
    code inside the quotes that contains a apostrophe, or quote must be
    escaped. (see above) And its a good idea to make sure all your
    rotating images are the same size. Otherwise your layout can get kinda
    ugly.

    This script will load a random image each time a user visits your
    page, nothing more.


    mzanime.com Guest

  5. #4

    Default Re: Switch Images

    That did it!

    Thank you!

    Kelly

    :)
    kelly @ herco Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139