The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Javascript in HTML
htmlbeg
post Apr 16 2012, 08:09 PM
Post #1


Newbie
*

Group: Members
Posts: 14
Joined: 28-February 12
Member No.: 16,597



Hi,
I am using javascript to randomize the 9 images in html to appear differently each time the page is loaded!
I am so not sure where to begin and would appreciate any starters advice or help!

I know i need variables, but how do I make the 9 images to appear randomly each time..

Thanks for all your help

The code is below. As you can tell I have only introduced java as the script, I dont know what to do next. I think I need to use Math random or something...


CODE


<title>Shady Plants</title>
</head>
<h1>
<span style="color:#f50">Shady</span>
<span style="color:#ff0">Plants</span>
</h1>

<body>
    <section>
        <article>
            <p>Have you ever wondered why your plants just die when you do all the right things? It may be because your plants dont require too much sunlight
            (or the other way around). Shady plants are good for small gardens, and cramped places where the sun doesnt reach all the way. However, you can still
            grow beautiful plants like the ones below. It really just depends on your taste as to what you would like to grow. If you have a green thumb, you can
            try your hand at exotic flowers such as bleeding hearts, wild ginger, and fairy wings. Or, if you prefer regular shaped normal flowers, you can try
            Forget-Me-Nots, trillium, and creeping buttercups. If you like big and wide spreading flowers, you can plant brazilian plume, and blue buggleweed. And,
            if your looking to be inspired, try the beautiful Tiger Monkey flower. Good Look Flowering! Also, try to guess which name belongs to which flower,
            they are all pretty easy to unravel. </p>
        </article>
        <article>
        <div id="pictures">

        <img src="1.jpg" alt="flower" width="304" height="228" />
        <img src="2.jpg" alt="Pulpit rock" width="304" height="228" />
        <img src="3.jpg" alt="Pulpit rock" width="304" height="228" />
        <img src="4.jpg" alt="Pulpit rock" width="304" height="228" />
        <img src="5.jpg" alt="Pulpit rock" width="304" height="228" />
        <img src="6.jpg" alt="Pulpit rock" width="304" height="228" />
        <img src="7.jpg" alt="Pulpit rock" width="304" height="228" />
        <img src="8.jpg" alt="Pulpit rock" width="304" height="228" />
        <img src="9.jpg" alt="Pulpit rock" width="304" height="228" />
        <script type="text/javascript">
            
        </script>
        </div>
        </article>
    </section>
    <footer>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 07:01 PM