PLEASE HELP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • matt.sus@gmail.com

    PLEASE HELP

    This has been driving me crazy for days:

    IF ANYONE CAN HELP FIX THE HTML BELOW, PLEASE HELP! (please email me
    at matt.sus@gmail. com - or reply here)

    i am trying to load up a random background image which is the
    background for the table. at the moment the image in the html is named
    1.jpg (and i woulld like it to rotate with 3 other images 2.jpg, 3.jpg,
    4.jpg)


    I'm not sure if i need to put something in the head tags, if it is java
    script that i need, and although i have done random images before, it
    seems more difficult that it is a background and that it isn';t a page
    background but a table background.


    here goes, and help appreciated:




    <html>
    <head>
    <title>Untitl ed Document</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <style type="text/css">
    <!--
    ..style1 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    }
    ..style4 {color: #000000}
    -->
    </style>
    </head>


    <body>
    <table width="850" height="589" border="0" align="center"
    background="1.j pg">
    <tr>
    <td width="436" height="182" align="left" valign="top"> </td>
    <td height="182" colspan="2"> </td>
    <td width="116" height="182"> </td>
    <td width="114" height="182"> </td>
    </tr>
    <tr>
    <td height="177"> </td>
    <td height="177" colspan="2"> </td>
    <td height="177"> </td>
    <td height="177"> </td>
    </tr>
    <tr align="left" valign="middle" >
    <td height="54" valign="bottom" nowrap><form action="" method="post"
    name="form1">

    <input name="textfield " type="text" value="client login" size="15">
    <input name="textfield 2" type="text" value="password " size="15">
    <input type="submit" name="Submit" value="Go">
    </form></td>
    <td height="54" colspan="2"> </td>
    <td height="54" nowrap> </td>
    <td height="54" nowrap> </td>
    </tr>
    <tr>
    <td height="165" valign="top"><p class="style1"> </p>
    </td>
    <td width="30" height="165" align="center" valign="middle" > </td>
    <td width="132" height="165" align="center" valign="bottom" ><p
    class="style1"> Clients</p></td>
    <td width="116" height="165" align="center" valign="bottom"
    class="style1"> <p>Staff</p> </td>
    <td width="114" height="165" align="center" valign="bottom" ><p
    class="style1"> Text service </p> </td>
    </tr>
    </table>
    </body>
    </html>

  • Evertjan.

    #2
    Re: PLEASE HELP

    wrote on 23 dec 2004 in comp.lang.javas cript:[color=blue]
    > This has been driving me crazy for days:
    >
    > IF ANYONE CAN HELP FIX THE HTML BELOW, PLEASE HELP! (please email me
    > at matt.sus@gmail. com - or reply here)
    >[/color]

    There is no javascript in your problem, so please ask elsewhere.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • matt.sus@gmail.com

      #3
      Re: PLEASE HELP

      i had been told on another forum that javascript was involved, thats
      why i posted here, the javascript forum.

      Comment

      • sbriet@hotmail.com

        #4
        Re: PLEASE HELP

        There is an example at http://www.dyn-web.com/javascript/rotate-img/

        matt.sus@gmail. com wrote:[color=blue]
        > i had been told on another forum that javascript was involved, thats
        > why i posted here, the javascript forum.[/color]

        Comment

        • matt.sus@gmail.com

          #5
          Re: PLEASE HELP

          none of the examples on that website deal with a random image as a
          background of a table. can anyone help?

          Comment

          • McKirahan

            #6
            Re: PLEASE HELP

            <matt.sus@gmail .com> wrote in message
            news:1103845400 .182418.108770@ f14g2000cwb.goo glegroups.com.. .[color=blue]
            > none of the examples on that website deal with a random image as a
            > background of a table. can anyone help?
            >[/color]

            Responses are under "Random Background Image Scripts??" in
            comp.lang.javas cript.


            Comment

            • Evertjan.

              #7
              Re: PLEASE HELP

              wrote on 24 dec 2004 in comp.lang.javas cript:
              [color=blue]
              > none of the examples on that website deal with a random image as a
              > background of a table. can anyone help?[/color]

              As your are posting on usenet,
              please quote the part of the posting you are replying on.

              --
              Evertjan.
              The Netherlands.
              (Please change the x'es to dots in my emailaddress)

              Comment

              • Martin Walke

                #8
                Re: PLEASE HELP

                Hi Matt,

                You need to place some javascript code into the file:

                Add this between your header tags

                <script>
                function RndImage(t) {
                var i = parseInt(Math.r andom() * 5) + 1;
                document.getEle mentById(t).bac kground = i + ".jpg";
                }
                </script>

                and then change your code at the beginning of the body to this:

                <body onLoad='RndImag e("imgTable");' >
                <table id="imgTable" width="850" height="589" border="0" align="center"
                background="1.j pg">
                This will give you random images from 1 to 5 - change the number 5 in the
                function to give you more (or less) images.

                HTH

                Merry Christmas

                Martin

                <matt.sus@gmail .com> wrote in message
                news:1103845400 .182418.108770@ f14g2000cwb.goo glegroups.com.. .
                [color=blue]
                > none of the examples on that website deal with a random image as a
                > background of a table. can anyone help?
                >[/color]


                Comment

                • Dr John Stockton

                  #9
                  Re: PLEASE HELP

                  JRS: In article <41cbe0c2$1@new s.star.co.uk>, dated Fri, 24 Dec 2004
                  10:15:45, seen in news:comp.lang. javascript, Martin Walke
                  <martin.walke@s pamvega.co.uk> posted :
                  [color=blue]
                  >var i = parseInt(Math.r andom() * 5) + 1;[/color]

                  Why do you recommend parseInt , involving conversion to String and back
                  again, instead of Math.floor as in the newsgroup FAQ, or possibly |0 ?

                  --
                  © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                  <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
                  <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                  <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                  Comment

                  Working...