Problem with java script?

Discussion in 'Javascript' started by CeNo, Dec 20, 2003.

  1. CeNo

    CeNo Guest

    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....Anyways, 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="#0099FF">
    <div align="center">
    <p><font size="7" face="Comic Sans MS"><strong><font 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="OnImgLoad()"> </p>

    <p align="center"><b>Caption: </b> <SPAN id="_Ath_FileName"> </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="JavaScript1.2">

    /*
    Interactive Image slideshow with text description
    By Christian Carlessi Salvadó (). 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(fFwd)
    {
    if (fFwd)
    {
    if (++g_iimg==g_imax)
    g_iimg=0;
    }
    else
    {
    if (g_iimg==0)
    g_iimg=g_imax;
    g_iimg--;
    }
    Update();
    }

    function getobject(obj){
    if (document.getElementById)
    return document.getElementById(obj)
    else if (document.all)
    return document.all[obj]
    }

    function Update(){
    getobject("_Ath_Slide").src = g_ImageTable[g_iimg][0];
    getobject("_Ath_FileName").innerHTML = g_ImageTable[g_iimg][1];
    getobject("_Ath_Img_X").innerHTML = g_iimg + 1;
    getobject("_Ath_Img_N").innerHTML = g_imax;
    }


    function Play()
    {
    g_fPlayMode = !g_fPlayMode;
    if (g_fPlayMode)
    {
    getobject("btnPrev").disabled = getobject("btnNext").disabled = true;
    Next();
    }
    else
    {
    getobject("btnPrev").disabled = getobject("btnNext").disabled = false;

    }
    }
    function OnImgLoad()
    {
    if (g_fPlayMode)
    window.setTimeout("Tick()", g_dwTimeOutSec*1000);
    }
    function Tick()
    {
    if (g_fPlayMode)
    Next();
    }
    function Prev()
    {
    ChangeImage(false);
    }
    function Next()
    {
    ChangeImage(true);
    }


    ////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.getElementById||document.all)
    window.onload=Play

    </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.
    CeNo, Dec 20, 2003
    #1
    1. Advertising

  2. CeNo wrote on 20 Dec 2003 at Sat, 20 Dec 2003 10:03:51 GMT:

    > 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....Anyways, 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="#0099FF">
    > <div align="center">
    > <p><font size="7" face="Comic Sans MS"><strong><font
    > color="#000000"
    > size="5">ROYAL
    > BOROUGH FC 2003/04</font></strong></font> </p>
    > <p>&nbsp;</p>
    > </div>
    > </body>
    > </html>


    <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
    d (replace ".invalid" with ".uk")
    Michael Winter, Dec 20, 2003
    #2
    1. Advertising

  3. CeNo

    bagbourne Guest

    CeNo wrote:

    > 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....Anyways, the images dont load in the slide show, and I cant fathom
    > out why....


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

    IE is crap at reporting them.
    bagbourne, Dec 20, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cédric Rossé
    Replies:
    1
    Views:
    517
    Cédric Rossé
    Nov 9, 2004
  2. Rajat
    Replies:
    3
    Views:
    677
    Jorgen Grahn
    Jan 8, 2010
  3. VYAS ASHISH M-NTB837
    Replies:
    2
    Views:
    540
    Jan Kaliszewski
    Jan 7, 2010
  4. Speed Knownas
    Replies:
    12
    Views:
    301
    Mike Stephens
    Jun 25, 2009
  5. Replies:
    3
    Views:
    111
Loading...

Share This Page