Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Website Design/Showcase (http://www.chiefdelphi.com/forums/forumdisplay.php?f=64)
-   -   DHTML Problem (http://www.chiefdelphi.com/forums/showthread.php?t=18951)

sanddrag 08-03-2003 18:47

DHTML Problem
 
I have a page where I want to implement a DHTML Navigation Bar and a DHTML Countdown Script. Each script works great separately but when both are in the same html file, the first one (nav bar) doesn't work. Any ideas?

Rickertsen2 08-03-2003 19:42

we ll you really haven't told us enough to help. could you post your code?

sanddrag 08-03-2003 21:30

1 Attachment(s)
You can see what the Nav Bar is supposed to look like at www.team696.org/navhome.html (not all the links in the bar work yet) I took out the countdown to make this work.

The code for the page with both scripts is too long to post so here is an attatched txt file.

Rickertsen2 08-03-2003 21:47

1 Attachment(s)
comment out the line:
window.onload=start_countdown

add the lines:
<script type='text/javascript'>
start_countdown()
</script>



like such:

sanddrag 08-03-2003 21:57

Nifty. Thanks a bundle.

<edit> And I guess because the counter now loads last, the page seems to load faster. Thanks</edit>

-sanddrag

And for anyone else who reads this, what happened in this thread was the kind of speedy, quality assistance that every FIRST-er is willing to give. Now THAT, is gracious professionalism.

jonathan lall 11-03-2003 20:08

I haven't yet looked through your code, but I'd speculate that the problem was that both scripts required a function to be assigned to window.onload so that the function will be called when the browser has finished loading the page. When the second one is assigned to window.onload it overwrites the first one. This is normal browser behaviour and can also be solved by adding an onload element to your body attribute with the two onloads seperated by semicolons:

onload= "scriptOne();scriptTwo()"

So there's another solution. If I diagnosed the problem right. Maybe I'll actually look a the code if I get time. :)


All times are GMT -5. The time now is 01:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi