Problem with java script?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CeNo

    Problem with java script?

    All,

    Any help would be appriecated here...I have downloaded a working script, for
    use with a web site of images. The java is a slide show of
    images....Anywa ys, the images dont load in the slide show, and I cant fathom
    out why....

    The site is here....


    the script is here.....

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Royal Borough FC</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#0099F F">
    <div align="center">
    <p><font size="7" face="Comic Sans MS"><strong><fo nt color="#000000"
    size="5">ROYAL
    BOROUGH FC 2003/04</font></strong></font> </p>
    <p>&nbsp;</p>
    </div>
    </body>
    </html>
    <p align="center"> <input type="button" id="btnPrev" value="<< Previous"
    onclick="Prev() ;"> <input type="button" id="bntPlay" value="Play - Stop"
    onclick="Play() "> <input type="button" id="btnNext" value=" Next >> "
    onclick="Next() ;"></p>

    <p align="center"> <img id="_Ath_Slide " onload="OnImgLo ad()"> </p>

    <p align="center"> <b>Caption: </b> <SPAN id="_Ath_FileNa me"> </SPAN> <br>
    <b>Number of Pictures: <SPAN id="_Ath_Img_X" ></SPAN> of <SPAN
    id="_Ath_Img_N" ></SPAN></b></p>

    <p align="center">

    <script language="JavaS cript1.2">

    /*
    Interactive Image slideshow with text description
    By Christian Carlessi Salvadó (cocolinks@c.ne t.gt). Keep this notice intact.
    Visit http://www.dynamicdrive.com for script
    */


    g_fPlayMode = 0;
    g_iimg = -1;
    g_imax = 0;
    g_ImageTable = new Array();

    function ChangeImage(fFw d)
    {
    if (fFwd)
    {
    if (++g_iimg==g_im ax)
    g_iimg=0;
    }
    else
    {
    if (g_iimg==0)
    g_iimg=g_imax;
    g_iimg--;
    }
    Update();
    }

    function getobject(obj){
    if (document.getEl ementById)
    return document.getEle mentById(obj)
    else if (document.all)
    return document.all[obj]
    }

    function Update(){
    getobject("_Ath _Slide").src = g_ImageTable[g_iimg][0];
    getobject("_Ath _FileName").inn erHTML = g_ImageTable[g_iimg][1];
    getobject("_Ath _Img_X").innerH TML = g_iimg + 1;
    getobject("_Ath _Img_N").innerH TML = g_imax;
    }


    function Play()
    {
    g_fPlayMode = !g_fPlayMode;
    if (g_fPlayMode)
    {
    getobject("btnP rev").disabled = getobject("btnN ext").disabled = true;
    Next();
    }
    else
    {
    getobject("btnP rev").disabled = getobject("btnN ext").disabled = false;

    }
    }
    function OnImgLoad()
    {
    if (g_fPlayMode)
    window.setTimeo ut("Tick()", g_dwTimeOutSec* 1000);
    }
    function Tick()
    {
    if (g_fPlayMode)
    Next();
    }
    function Prev()
    {
    ChangeImage(fal se);
    }
    function Next()
    {
    ChangeImage(tru e);
    }


    ////configure below variables/////////////////////////////

    //configure the below images and description to your own.
    g_ImageTable[g_imax++] = new Array ("12140001.jpg" , "It's a big bogey!");
    g_ImageTable[g_imax++] = new Array ("12140002.jpg" , "Honest ref, we don't
    know where the ball is.");
    g_ImageTable[g_imax++] = new Array ("12140003.jpg" , "Toby says...I'm gonna
    nut that ref!");
    g_ImageTable[g_imax++] = new Array ("12140005.jpg" , "Lonesome") ;
    g_ImageTable[g_imax++] = new Array ("12140007.jpg" , "RUN, don't walk!");
    g_ImageTable[g_imax++] = new Array ("12140008.jpg" , "Blinded by the
    light...");
    g_ImageTable[g_imax++] = new Array ("12140009.jpg" , "Still blinded by the
    light.");
    g_ImageTable[g_imax++] = new Array ("12140010.jpg" , "I wish someone would
    wash my kit!");
    g_ImageTable[g_imax++] = new Array ("12140011.jpg" , "Watch out Toby, that
    bloke behind you is looking at your ass!");
    g_ImageTable[g_imax++] = new Array ("12140012.jpg" , "Now he's looking at
    neil's ass!");
    g_ImageTable[g_imax++] = new Array ("12140026.jpg" , "Again?");
    g_ImageTable[g_imax++] = new Array ("12140029.jpg" , "That's my better
    side!");
    g_ImageTable[g_imax++] = new Array ("12140036.jpg" , "Steve walking of with
    the ball");
    g_ImageTable[g_imax++] = new Array ("12140038.jpg" , "That is a slanting
    pitch!");
    g_ImageTable[g_imax++] = new Array ("12140040.jpg" , "I will get up when you
    give me the ball!");
    g_ImageTable[g_imax++] = new Array ("12140041.jpg" , "Never cuss someone down
    behind their back");
    g_ImageTable[g_imax++] = new Array ("12140043.jpg" , "Stuart takes them all
    on");
    g_ImageTable[g_imax++] = new Array ("12140044.jpg" , "Good tackle, shame you
    did not get player or ball!");
    g_ImageTable[g_imax++] = new Array ("12140045.jpg" , "The cousins are after
    number 14!");
    g_ImageTable[g_imax++] = new Array ("12140046.jpg" , "Well in Barry! Why is
    he kicking you though?");
    g_ImageTable[g_imax++] = new Array ("12140051.jpg" , "The Ball is in front of
    you Neil!");
    g_ImageTable[g_imax++] = new Array ("12140053.jpg" , "Funeral march");
    g_ImageTable[g_imax++] = new Array ("12140054.jpg" , "hmmmm, grass!");
    g_ImageTable[g_imax++] = new Array ("12140055.jpg" , "Pufferman? ");
    g_ImageTable[g_imax++] = new Array ("12140056.jpg" , "I dont wanna play no
    more!");
    g_ImageTable[g_imax++] = new Array ("12140057.jpg" , "Ref with his fags in
    his pocket.");
    //extend the above list as desired
    g_dwTimeOutSec= 7

    ////End configuration/////////////////////////////

    if (document.getEl ementById||docu ment.all)
    window.onload=P lay

    </script>
    </p>



    I am using dreamweaver to compile the site, I am running XP Pro SP1, IE 6
    SP1.....

    Any help would be great, many thanx

    Sean.


  • Michael Winter

    #2
    Re: Problem with java script?

    CeNo wrote on 20 Dec 2003 at Sat, 20 Dec 2003 10:03:51 GMT:
    [color=blue]
    > All,
    >
    > Any help would be appriecated here...I have downloaded a working
    > script, for use with a web site of images. The java is a slide
    > show of images....Anywa ys, the images dont load in the slide show,
    > and I cant fathom out why....
    >
    > The site is here....
    > www.royalboroughfc.myby.co.uk
    >
    > the script is here.....
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    > <html>
    > <head>
    > <title>Royal Borough FC</title>
    > <meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1"> </head>
    >
    > <body bgcolor="#0099F F">
    > <div align="center">
    > <p><font size="7" face="Comic Sans MS"><strong><fo nt
    > color="#000000"
    > size="5">ROYAL
    > BOROUGH FC 2003/04</font></strong></font> </p>
    > <p>&nbsp;</p>
    > </div>
    > </body>
    > </html>[/color]

    <snipped rest of document>

    This could be your problem right here. Move the </body> and </html>
    closing tags to the bottom of the page and try it again. That might
    not solve all of your problems (I haven't checked the rest), but this
    is a good place to start.

    Mike

    --
    Michael Winter
    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk")

    Comment

    • bagbourne

      #3
      Re: Problem with java script?

      CeNo wrote:
      [color=blue]
      > All,
      >
      > Any help would be appriecated here...I have downloaded a working script, for
      > use with a web site of images. The java is a slide show of
      > images....Anywa ys, the images dont load in the slide show, and I cant fathom
      > out why....[/color]

      Try running it on Mozilla with the Javascript console displayed and see
      if you get any script errors.

      IE is crap at reporting them.

      Comment

      Working...