34 users online (0 members and 34 guests)  


  Results 1 to 7 of 7

Related

  1. Replies: 8
  2. Replies: 0
  3. Resolution Conflicts    Forum: HTML Forum
    Replies: 4
  1. #1
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652

    SCRIPT conflicts

    This isn't a critical problem because the site already has enough bells and whistles to sustain a visitor for a while, but there are two SCRIPTS among the many at

    http://lethisnakeatail.com

    that won't work together - the bouncing head and the countdown script that normally appears under the sliding image table just before the lower menu URLs.

    The page is set to display the bouncing head, but if an extra } (char#125) is placed at line #444 the head will stop and the countdown script will display - it displays when one moves the mouse over the blank space under the sliding images box.

    I'm a year away (at least) from understanding JavaScript enough to spot what may be the possible conflict in those two <SCRIPT ...>s. Anyone else out there with a fix for this conflict?

  2. #2
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    hmm... could you put the two scripts that are having problems here? Thanks, not quit sure which one is the bouncing head script.

  3. #3
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    Ignore the char#124s - Bouncing head/image:

    <script language="JavaScript"> ¦
    <!-- hide script from old browsers ¦
    ¦
    /*[*] SCRIPT: Bouncing Image Script COPYRIGHT: c 1999 Hass ¦[*] AUTHOR: Lloyd Hassell EMAIL: lloydhass@hotmail.com ¦[*] WWW: http://go.to/hass ¦[*] Permission granted to Dynamicdrive.com to feature script in archive ¦[*] Modified by Dynamicdrive.com for feature alteration ¦[*] For this and 100's more DHTML scripts, visit http://dynamicdrive.com ¦
    */ ¦
    ¦
    //Configure the below three variables (BallSpeed from 1 to 50, larger is faste¦
    var ballWidth = 38; ¦
    var ballHeight = 50; ¦
    var BallSpeed = 4; ¦
    ¦
    var maxBallSpeed = 50; ¦
    var xMax; ¦
    var yMax; ¦
    var xPos = 0; ¦
    var yPos = 0; ¦
    var xDir = 'right'; ¦
    var yDir = 'down'; ¦
    var superballRunning = true; ¦
    var tempBallSpeed; ¦
    var currentBallSrc; ¦
    var newXDir; ¦
    var newYDir; ¦
    ¦
    function initializeBall() { ¦
    if (document.all) { ¦
    xMax = document.body.clientWidth ¦
    yMax = document.body.clientHeight ¦
    document.all("superball").style.visibility = "visible"; ¦
    } ¦
    else if (document.layers) { ¦
    xMax = window.innerWidth; ¦
    yMax = window.innerHeight; ¦
    ¦ document.layers["superball"].visibility = "show"; ¦
    ¦ } ¦
    ¦ setTimeout('moveBall()',400); ¦
    ¦} ¦
    ¦ ¦
    ¦function moveBall() { ¦
    ¦ if (superballRunning == true) { ¦
    ¦ calculatePosition(); ¦
    ¦if (document.all) { ¦
    ¦ document.all("superball").style.left = xPos + document.body.scrollLeft; ¦
    ¦ document.all("superball").style.top = yPos + document.body.scrollTop; ¦
    ¦ } ¦
    ¦ else if (document.layers) { ¦
    ¦ document.layers["superball"].left = xPos + pageXOffset; ¦
    ¦ document.layers["superball"].top = yPos + pageYOffset; ¦
    ¦} ¦
    ¦ setTimeout('moveBall()',30); ¦
    ¦ } ¦
    ¦} ¦
    ¦ ¦
    ¦function calculatePosition() { ¦
    ¦ if (xDir == "right") { ¦
    ¦ if (xPos > (xMax - ballWidth - BallSpeed)) { ¦
    ¦ xDir = "left"; ¦
    ¦ } ¦
    ¦ } ¦
    ¦ else if (xDir == "left") { ¦
    ¦ if (xPos < (0 + BallSpeed)) { ¦
    ¦ xDir = "right"; ¦
    ¦} ¦
    ¦ } ¦
    ¦ if (yDir == "down") { ¦
    ¦if (yPos > (yMax - ballHeight - BallSpeed)) { ¦
    ¦ yDir = "up"; ¦
    ¦ } ¦
    ¦ } ¦
    ¦ else if (yDir == "up") { ¦
    ¦ if (yPos < (0 + BallSpeed)) { ¦
    ¦ yDir = "down"; ¦
    ¦ } ¦
    ¦ }
    ¦if (xDir == "right") {
    ¦ xPos = xPos + BallSpeed;
    ¦ }
    ¦else if (xDir == "left") {
    ¦ xPos = xPos - BallSpeed;
    ¦ }
    ¦else {
    ¦ xPos = xPos;
    ¦ }
    ¦if (yDir == "down") {
    ¦ yPos = yPos + BallSpeed;
    ¦ }
    ¦else if (yDir == "up") {
    ¦ yPos = yPos - BallSpeed;
    ¦ }
    ¦else {
    ¦ yPos = yPos;
    ¦ }
    ¦}
    ¦ // char#125 goes at beginning of this line to toggle head/countdown
    ¦if (document.all||document.layers)
    ¦window.onload = initializeBall;
    ¦window.onresize = new Function("window.location.reload()");
    ¦
    ¦// end hiding from old browsers -->
    ¦</script>

    which is activated by:

    <SPAN ID="superball"><A HREF=../rjc.htm><IMG BORDER=0 WIDTH=38 HEIGHT=50
    NAME="Ruben James (Theriault) Ciriacks" SRC=../ben/rjc98o.gif></A></SPAN>

    The other script is harder to cut and paste because of long lines but is activated by:

    <ilayer id="countdownnsmain" width=&{countdownwidth}; height=&{countdownheight¦
    <layer id="countdownnssub" width=&{countdownwidth}; height=&{countdownheight}¦
    </ilayer> ¦
    (Those are incomplete due to long lines but are in the source code at the site.)

  4. #4
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    did you stick this on the page?:

    Code:
    !--REM 02312 1424 1424  life\ltset.htm  14:29:53
        3=circleGROW  12=pixelFADE  21=HZfade  22=VTfade  23=random
      Either the bouncing head will work or the countdown but not both -
        place or remove a character #125 at line 445 just before the
        if (document.all||document.layers)     line to toggle between the two.
    -->
    cause if you didn't and they did then it probably won't happen, but just in case I'll take a long look at it.

  5. #5
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    Yes, everything between the <!-- and --> are comments placed there by me. The top line emulates that of each and every file (.bat, .txt, .htm, .js, etc) that I access and edit via QEdit. I use the Ctrl-6 key combination to automatically update the latest date and time. It tells me when the file was last updated, the date it was last printed or had a major overhaul and the date it was first created; followed by the path and filename so that when it's printed or otherwise being looked at, I can determine what it is and where place/find it on the hardrive; and finally, by the 24 hour time of last update.

    There's some other scripts acting up on the other two pages, too. The watermark script works when placed outside the </HTML> tag but, for some reason is suddently not working on the ltset10.htm and ltset30.htm pages. I can see that learning all the idiocyncracies of JavaScript is going to be as time consuming and interesting as learning those for HTML coding. That should keep my mind from wandering into senility too quickly.

  6. #6
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    after viewing all your code I've just got one thing to say:

    I'm pretty good with JavaScript... but I'm not near an expert with DHTML lol.

    Sorry, can't find a problem. The one won't work with the other, and after trying a few things I couldn't make anything work so ya, sorry.

  7. #7
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    Thanks for the effort. It's no big deal given that there are plenty of other SCRIPTs on that page that are working together. I'll toggle between those that work and not every now and then, OR, when the page is fairly complete, create duplicate pages to allow visitors to choose which SCRIPT to activate in place of the other.

    If JavaScript is like most of my other learning curves, it'll take at least 3 months of 'manic' concentration to get into it and then another 9 months of testing and playing around to learn some of the 'undocumented' tricks, techniques and idiocyncracies. The problem, of course, is finding a window of 3 months to dedicate to anything.

    And, that site is designed for people wanting to waste time, anyway, so making it "perfect" isn't a priority. I spend time on it when the mood hits me.



Tags for this Thread