View Full Version : JS generated menu and JS generated mouse effects
centurian
10-22-2002, 12:57 PM
Hello ppl,
Nice place you've got here. I've searched for a solution in the older threads, but came up empty handed.
I'm not really a programmer, but get things running after a fashion.
I have found a menu that I would like to use, generated with JS. It works wonderfully. I would also like to use (found) mouse effects generated with JS (Bats for Halloween, Santa at Christmas etc), they work wonderfully also. PROBLEM. I can't get them to work together! The menu is the sufferer. Is it because the two effects are trying the draw to the same place or what?
I know you are going to ask me to post some code, but before I suss out a way for you to see the code(s), I would like to know if it is at all possible.
Or am I flogging a dead horse?
The menu is something like the menu Piglet (http://homepage.ntlworld.com/thepiglet/stephen/xfmenu.html) has on his site.
Thanx in advance.
Steve
Roy Sinclair
10-22-2002, 03:25 PM
We don't need to see piglet's site, it's working. What we need to see is your non-functional pages. We can hardly help you find the problem if we can't see the code.
beetle
10-22-2002, 05:08 PM
Possible, yes. Easy, probably not.
The biggest problem with free scripts in proliferation on the web are the amount of global namespace they consume. So many use an absurdly large number of global variables and whatnot. Most likely the problems between your scripts are conflicts with variable and/or function names.
centurian
10-22-2002, 05:46 PM
thanx for the quick answers!
The menu is here http://www.lilley.de/sample8/sample8.html
The mouse is here http://www.lilley.de/followcursor/followcursor.html
I'm sorry if you took that wrong Roy Sinclair, I know Piglets works, I just wanted you to get the idea of the sort it is - menu in one frame, subs in another! No point in giving a menu as an example if it doesn't work:(
I know you're gonna say :eek:! Trash 'em and start learning JS. I'm on my way right now to amazon.com for some books :o
Thanx again:thumbsup:
Roy Sinclair
10-22-2002, 06:37 PM
Well here's the problems I see, the Piglet menu isn't the same menu as the other one you're trying. Both of the scripts you want to use are trying to use the onload event so you've got to deal with that conflict or the last script to "grab" the onload event wins and the other script fails.
Piglet's menu is a cross-frames menu while the other menu is not. If that's what you want then forget using the other menu, there's a world of difference and converting a menu to work cross frame is outside the scope of getting help here.
Educating yourself is a good plan.:thumbsup:
centurian
10-22-2002, 06:53 PM
Thanx Roy for that,
sample8 is in fact cross frame (note the BG colour difference and scrollbar), but that's besides the point. As you say first come, first served on the onload, so no need to look further huh!
Just ordered the 'Javascript Bible' from Danny Goodman at amazon.co.uk - its a biggie and whilst I don't know JS apart from looking and playing around with the odd script, I wrote lots in AmigaBasic many years ago, so I've an idea of whats coming. Lots of midnight oil!:eek: :eek:
Thanx again
Steve
centurian
10-22-2002, 06:59 PM
Me again! I just had a thought. I know 'onload' is normally in the body tag, which is why first come first served. However, what if the 'onload's are declared together:
<body onload="doOne(); doTwo(); doThree()"> ?
Like I said, just a thought.
Roy Sinclair
10-22-2002, 07:18 PM
Originally posted by centurian
Me again! I just had a thought. I know 'onload' is normally in the body tag, which is why first come first served. However, what if the 'onload's are declared together:
<body onload="doOne(); doTwo(); doThree()"> ?
Like I said, just a thought.
That's exactly how multiple scripts requiring the use of the onload event are usually handled. Be aware that if you're using frames that the script for the menu would be triggered in the page for the frame with the menu while the script for the mouse following whatits would be in the page or pages where the body of the site is contained so there might not be a conflict unless the menu also requires each loading page to call it.
centurian
10-22-2002, 07:35 PM
OK Roy, got that! So thats why the menu looses out, because the mouse calls from a page later. Two totally different functions (mouse and menu) can't be in one script, because the menu is static, and the mouse is on every page, right?
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.