Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    8
    Member #
    3727
    Quick question:

    Would anyone know what would cause a script to stop working when a second has been inserted? I have a script in the head tag that operates image rollovers in a menu, but then lower in the body there are 3 other scripts that make up a scrolling text window, however, when the scrolling text script was inserted, the rollovers stopped working. I checked for same property names and such but I got nothin, any ideas?

    Thanks

  2.  

  3. #2
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    Check to see that all your onLoad functions are defined and referencing valid functions. Also, post the error that the page produces (and maybe upload the html file) so that if this isn't the problem, we may better troubleshoot this error.
    - Brian

  4. #3
    Junior Member
    Join Date
    Oct 2003
    Posts
    8
    Member #
    3727
    skrlin,

    thanks for the suggestion, for the onload statement, only the image rollovers has one, theres wasnt one for the news scroller and the scroller is the only thing that works, i uploaded the page, if you or anyone else gets a chance to review it I would really appriciate it. Thanks

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    could be your scrolling div is overlapping your mouseover images? Try setting the z-index lower on the inner div lower and see if that fixes anything.

    Also, hmm... your last script doesn't have any semicolons at the end of lines

    Code:
    <script type="text/javascript" language="javascript">
    <!--
    iens6=document.all||document.getElementById;
    ns4=document.layers;
    var speed=5;
    if (iens6){
    document.write('<div id=\"container\"
        style=\"position:relative;width:375px;height:260px;overflow:hidden\">');
    document.write('<div id=\"content\" 
        style="position:absolute;width:370px;left:0;top:0; z-index:-1\">');
    }
    -->
    </script>

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    NOTE: Remove any extra line breaks and spaces added by the forum software into the script samples above.

  7. #6
    Junior Member
    Join Date
    Oct 2003
    Posts
    8
    Member #
    3727
    I added the semicolons, didnt change anything, and the div layer that holds the script is below the image rollovers so no overlapping there. Im completely stumped. Funny though, when i was messing with the scroll code, I missed a quotation mark somewhere which made it error, and when the scroll script errored, the rollovers worked again, go figure.

    Thanks -

  8. #7
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    LOL

    Well you know it's not an error, because the page isn't showing any errors during execution.

    I did some debugging and found your problem.

    The function preloadImages() is never getting called, which means the flag preloadFlag is not getting set to "true", which means that changeImages() won't execute, because it requires preloadFlag == true.

    The only answer I don't have is WHY preloadImages() isn't executing.... it SHOULD. I'm gonna keep messing with it and see what I can find.

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    This will work... put the following line at the END of your source:
    Code:
    <script>preloadImages();</script>
    Not a substitute for getting the <body onload> event working, but it will have the same effect of preloading the images after the page is done loading.

    I think in retrospect that your errors are coming from the embedded <script>s in your <body>. As a rule, you should only have <script> elements as children of the <head> element. For sure, this is one of the many bugs that can arise from embedding scripts in the body. If you can, try to put all your javascript into the head to avoid other problems like this in the future !!!

  10. #9
    Junior Member
    Join Date
    Oct 2003
    Posts
    8
    Member #
    3727
    thank you so much, that worked perfect. I know its better to keep scripts in the head tag but when I tried putting this one there it didnt work.. I may have screwed something up though. Anyway thanks again man


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:24 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com