SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Rome
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Javascript and browsers status bar!

    I want to use a nice javascript scroller that i found here http://www.greywyvern.com/javascript.php .It is all ok!
    But...when i go or refresh the page in whic there is the javascript, my browser status bar don't finish up and it does not display the usually "Done" !
    It display always "transferring data from xxx.xxx.com" and seems it doesn't finish load web-page!
    I am using Mozilla 1.7 and Firefox 0.9 !
    You can get a demo of this here http://www.kdo.it/extra/scrollbeta.php
    The code of my php page is here:
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//IT">

    <html>
    <head>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
       <title>Prova Scroller</title>
    <style type="text/CSS">
       .scrollClass {
         text-align:center;
         font:normal 70% Arial,sans-serif;
       }
       .scrollClass2 {
         text-align:center;
         font:normal 80% Courier,monospace;
         background-color:blue;
       }
       .scrollClass3 {
         text-align:right;
         font:bold 100% Arial,sans-serif;
         background-color:#ffda00;
         color:#00adff;
       }
     </style>
     
    </head>
    <body onload="scObj1.scroll();">
    <script type="text/javascript">

    var scObj1 = new scrollObject("scObj1", "Main", 120, 120, "white", "up", 1.45, 3, 30, 5000, "scrollClass");
    <?php
    /* #####################################################################################
     *
     * $Id: lastactions.php,v 1.37 2004/02/22 12:23:18 mabu Exp $
     *
     * This notice must remain untouched at all times.
     *
     * Modifications to the script, except the official addons or hacks,
     * without the owners permission are prohibited.
     * All rights reserved to their proper authors.
     *
     * ---------------------------------------------
     * [url]http://www.vwar.de[/url] || Copyright (C) 2001-2004
     * ---------------------------------------------
     *
     * #####################################################################################
     */

    // ####################################### CONFIGURATION  ###############################

    // path to your main vwar-directory (with final ' / ')
    // -> from the site, where this extra is included!
    // -> use absolute path if you have it included in files with different directories!
    // -> if included in your _header.php/_footer.php, it is normally: './'
    // -> if not, use: './../'
    $vwar_xroot     "./../";

    // define number of lastactions
    // limits display to x last actions
    $numlastactions 3;

    // include header- & footer-information (1=enabled / 0=disabled)
    $include        0;
    $****= 
    0;
    $urltovwar "http://www.kdo.it/";

    function 
    makeimgtagmodified($path,$alt="",$align="middle",$width="",$height="")
    {
        if (!
    $width && ($size = @getimagesize($path)))
        {
            
    $width $size[0];
            
    $height $size[1];
        }
        return 
    "<img src=\\\"{$path}\\\" " .
            
    ifelse($alt'alt=\\"' $alt '\\" ''') .
            
    ifelse($align'align=\\"' $align '\\" ''')    .
            
    ifelse($width'width=\\"' $width '\\" ''')    .
            
    ifelse($height'height=\\"' $height '\\" ''') .
            
    'border=\\"0\\">';
    }

    // ######################################################################################


    // ################################### display lastactions  ############################

    // check, if we need to get some global vars or if we need to include them
    if( !defined ("VWAR_COMMON_INCLUDED") )
    {
        
    $vwar_root $vwar_xroot;
        require_once ( 
    $vwar_root "includes/functions_common.php" );
    }

    if ( 
    $include == )
    {
        include_once ( 
    $vwar_root "_header.php" );
    }


    $dateline = (time() - ($waroverlap 60)) + ($timezoneoffset 3600);

    $result $vwardb->query_first("
        SELECT COUNT(warid) AS numwars
        FROM vwar"
    .$n."
        WHERE status='1'
        AND dateline <= '
    $dateline'
    "
    );
    $numlastwars $result['numwars'];

    if (
    $numlastwars 0)
    {
        $****= 
    0;    // cache scores
            
    if(!isset($scorecache))
            {
                
    $scorecache createScoreCache();
            }

        
    $result $vwardb->query("
            SELECT vwar"
    .$n.".warid, vwar".$n.".gametypeid, vwar".$n.".matchtypeid, vwar".$n.".resultbylocations, status,
                vwar"
    .$n.".dateline, vwar".$n.".oppid, oppircchannel, oppircnetwork, oppnameshort, oppcountry, matchtypename, gametypename,oppcountry,
                vwar"
    .$n."_games.gameicon, vwar".$n."_games.gamename
            FROM vwar"
    .$n.", vwar".$n."_matchtype, vwar".$n."_gametype, vwar".$n."_opponents, vwar".$n."_games
            WHERE vwar"
    .$n.".oppid = vwar".$n."_opponents.oppid
            AND vwar"
    .$n.".gametypeid = vwar".$n."_gametype.gametypeid
                AND vwar"
    .$n."_matchtype.matchtypeid = vwar".$n.".matchtypeid
                AND vwar"
    .$n.".dateline <= '$dateline'
                AND status = '1'
                AND vwar"
    .$n.".gameid = vwar".$n."_games.gameid
            GROUP BY warid
            ORDER BY dateline DESC
            LIMIT 0, 
    $numlastactions
        "
    );
        while (
    $row $vwardb->fetch_array($result))
        {
            
    dbSelect($row);

            
    $result2 $vwardb->query_first("
                SELECT COUNT(commentid) AS numcomments
                FROM vwar"
    .$n."_comments
                WHERE frompage = 'war'
                AND sourceid = '" 
    $row['warid'] . "'
            "
    );
            
    $row['numcomments'] = $result2['numcomments'];
            
    $row['numcomments'] = empty($row['numcomments']) ? $row['numcomments'];

            
    $ownscoretotal 0;
            
    $oppscoretotal 0;
            
    $ownscoretotalbylocations 0;
            
    $oppscoretotalbylocations 0;

            
    $numcomments $row['numcomments'];

            if (
    $row['gameicon'] != "" && file_exists($vwar_root "images/gameicons/" $row['gameicon']))
            {
                
    $gameicon makeimgtagmodified($urltovwar "images/gameicons/" $row['gameicon'], $row['gamename']);
            } else {
                
    $gameicon="";
            }
            

    echo 
    "scObj1.block[".$****."] = \"<table border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" align=\\\"center\\\"><tr><td align=\\\"center\\\">$gameicon<a href=\\\" $ownhomepage\\\" target=\\\"_blank\\\">$ownnameshort</a> vs.$n"
                    if (
    $row['oppcountry']!="")
                {
                    echo 
    makeimgtagmodified("http://www.kdo.it/images/flags/" $row['oppcountry'] . ".gif",$country_array[$row['oppcountry']]);
                }
                else if (
    $showcountry == 1)
                {
                     echo 
    makeimgtagmodified("http://www.kdo.it/images/flags/nocountry.gif",$str['NOTAVAILABLE']);
                } 
                    echo 
    "<a href=\\\"$urltovwarwar.php?action=oppinfo&amp;oppid= $row[oppid] \\\"> $row[oppnameshort] </a></td></tr>";
            
            
    $ownscoretotal $scorecache[$row["warid"]]['sownscoretotal'];
            
    $oppscoretotal $scorecache[$row["warid"]]['soppscoretotal'];

            if(
    $showcoloredresults == 1)
            {
                if (
    $ownscoretotal $oppscoretotal$scorecolor $colorlost;
                else if (
    $ownscoretotal $oppscoretotal$scorecolor $colorwon;
                else if (
    $ownscoretotal == $oppscoretotal$scorecolor $colordraw;
            }

            if (
    $row['resultbylocations'] == 1)
            {
                            
    $oppscoretotalbylocations $scorecache[$row["warid"]]['loppscoretotal'];
                            
    $ownscoretotalbylocations $scorecache[$row["warid"]]['lownscoretotal'];

                if (
    $showcoloredresults == 1)
                {
                    if (
    $ownscoretotalbylocations $oppscoretotalbylocations)
                                    {
                                            
    $scorecolor $colorlost;
                                            
    $matchstatus makeimgtagmodifiedmodified($urltovwar "images/lost.gif");
                                    }
                    else if (
    $ownscoretotalbylocations $oppscoretotalbylocations)
                                    {
                                            
    $scorecolor $colorwon;
                                            
    $matchstatus makeimgtagmodifiedmodified($urltovwar "images/won.gif");
                                    }
                    else if (
    $ownscoretotalbylocations == $oppscoretotalbylocations)
                                    {
                                            
    $scorecolor $colordraw;
                                            
    $matchstatus makeimgtagmodifiedmodified($urltovwar "images/draw.gif");
                                    }
                }

                if (
    $showrealresults == 0)
                {
                    
    $ownscoretotal $ownscoretotalbylocations;
                    
    $oppscoretotal $oppscoretotalbylocations;
                }
            }
            if (
    $ownscoretotal $oppscoretotal$matchstatus makeimgtagmodified($urltovwar "images/won.gif");
            else if (
    $ownscoretotal $oppscoretotal$matchstatus makeimgtagmodified($urltovwar "images/lost.gif");
            else if (
    $ownscoretotal == $oppscoretotal$matchstatus makeimgtagmodified($urltovwar "images/draw.gif");
            
            echo 
    "<tr><td align=\\\"center\\\"><font color=\\\" $scorecolor\\\">$ownscoretotal&nbsp;:&nbsp;$oppscoretotal&nbsp;</font>$matchstatus<br /></td></tr><tr><td align=\\\"left\\\">&raquo;".date($longdateformat,$row[dateline])."</td></tr><tr><td align=\\\"left\\\">&raquo; <a href=\\\"".$vwar_root."war.php?action=details&amp;warid=$row[warid]\\\">details</a>[$numcomments <a href=\\\"".$urltovwar."war.php?action=comment&amp;warid=$row[warid]\\\"><img src=\\\"$urltovwarimages /comment.gif\\\" align=\\\"middle\\\" border=\\\"0\\\" alt=\\\"\\\"></a>]<br /><br /></td></tr></table>\";\n";
    $****++;
    }
        
    $vwardb->free_result($result);
    }
    else
    {
        
        echo 
    "<tr>
            <td align=\"center\"><font size=\"2\" font face=\"Tahoma\" color=\"red\">No Last Actions</td>
        </tr></table>"
    ;

    }
    ?>    


    /* **************************************************************************
    *** Don't pass this line ****************************************************
    ************************************************************************** */
    function scrollObject(objName, main, width, height, bkgcol, direct, deccel, begin, speed, pause, classname) {
      this.objName = objName;
      this.main = main;
      this.one = main + "Block1";
      this.two = main + "Block2";
      this.block = new Array();
      this.blockup = 1;
      this.divup = 1;
      this.height = height;
      this.width = width;
      this.bkgcol = bkgcol;
      this.direct = direct;
      this.deccel = Math.max(deccel, 1);
      this.begin = Math.max(Math.min(begin, (direct == "up" || direct == "down") ? height : width), 1);
      this.speed = speed;
      this.pause = pause;
      this.slide = ((direct == "up" || direct == "down") ? height : width) / this.begin;
      this.table = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td class=\"" + classname + "\" style=\"width:" + width + "px;height:" + height + "px;\">";
      this.scroll = scroll;
      this.scrollLoop = scrollLoop;
    }

    function scroll() {if (!document.getElementById) return false;
      document.getElementById(this.main).innerHTML = "<div id=\"" + this.one + "\"></div><div id=\"" + this.two + "\"></div>";
      var divList = [document.getElementById(this.main), document.getElementById(this.one), document.getElementById(this.two)];
      for (var i = 0; i <= 2; i++) {
        if (i > 0) {
          divList[i].style.position = "absolute";
          if (this.direct == "up" || this.direct == "down") {
            divList[i].style.left = "0px";
            divList[i].style.top = (i == 1) ? "0px" : ((this.direct == "up") ? "" : "-") + this.height + "px";
          } else {
            divList[i].style.left = (i == 1) ? "0px" : ((this.direct == "left") ? "" : "-") + this.width + "px";
            divList[i].style.top = "0px";
          } divList[i].innerHTML = this.table + this.block[i - 1] + "</td></tr></table>";
        } else {
          divList[i].style.position = "relative";
          divList[i].style.background = this.bkgcol;
        }
        divList[i].style.width = this.width + "px";
        divList[i].style.height = this.height + "px";
        divList[i].style.overflow = "hidden";
      } setTimeout(this.objName + ".scrollLoop();", this.pause);
    }

    function scrollLoop() {
      var divList = [document.getElementById(this.main), document.getElementById(this.one), document.getElementById(this.two)];
      this.slide = Math.max(this.slide / this.deccel, 1);
      var slideInc = (this.direct == "up" || this.direct == "left") ? -parseInt(this.slide) : parseInt(this.slide);
      if ((this.direct == "up" && Math.max(parseInt(divList[1].style.top) + slideInc, parseInt(divList[2].style.top) + slideInc) <= 0) ||
          (this.direct == "down" && Math.min(parseInt(divList[1].style.top) + slideInc, parseInt(divList[2].style.top) + slideInc) >= 0) ||
          (this.direct == "left" && Math.max(parseInt(divList[1].style.left) + slideInc, parseInt(divList[2].style.left) + slideInc) <= 0) ||
          (this.direct == "right" && Math.min(parseInt(divList[1].style.left) + slideInc, parseInt(divList[2].style.left) + slideInc) >= 0)) {
        this.slide = ((this.direct == "up" || this.direct == "down") ? this.height : this.width) / this.begin;
        if (++this.blockup >= this.block.length) this.blockup = 0;
        this.divup = (this.divup == 1) ? 2 : 1;
        if (this.direct == "up" || this.direct == "down") {
          divList[3 - this.divup].style.top = ((this.direct == "down") ? "-" : "") + this.height + "px";
          divList[this.divup].style.top = "0px";
        } else {
          divList[3 - this.divup].style.left = ((this.direct == "right") ? "-" : "") + this.width + "px";
          divList[this.divup].style.left = "0px";
        } divList[3 - this.divup].innerHTML = this.table + this.block[this.blockup] + "</td></tr></table>";
        setTimeout(this.objName + ".scrollLoop();", this.pause);
      } else {
        for (var j = 1; j <= 2; j++) {
          if (this.direct == "up" || this.direct == "down") {
            divList[j].style.top = (parseInt(divList[j].style.top) + slideInc) + "px";
          } else divList[j].style.left = (parseInt(divList[j].style.left) + slideInc) + "px";
        } setTimeout(this.objName + ".scrollLoop();", this.speed);
      }
    }

      </script>
    <div id="Main">
       The contents of this block will be displayed if the browser does not support the scroller.
       It will be overwritten if the scroller is supported.
     </div>


    </body>
    </html>
    What is the problem? How can i solve it?!
    thank you in advice for any suggets comments helps etc....

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Rome
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone plz!?

  3. #3
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since you are using Mozilla/Firefox, it is most likely becuase you have more than one tab open. I see this a lot, I will be viewing tab 1 which will be completely loaded, but the status bar will be giving me the status of tab 2, which is still loading.
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches


Bookmarks

Posting Permissions

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