/    Sign up×
Community /Pin to ProfileBookmark

Frustrating Expanding Menu Problem

Right here goes.

I have a website obviously, i have a photo gallery. I already have one expanding menu for one set of images, and im just in the process of adding another set which needs its own menu.

I cant get it to work, ive changed the id’s used two different script inclusions for it, and ive even resulted to php including them.

Here is the website [url]http://www.atlantisarchive.com/gallery[/url]

Can someone please, please, please help me.

The atlantis captures bit is the current expanding, the sg1 bit at the bottom is what i want to expand as well but its not at the mo

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@GSharpMay 29.2008 — Looking at the source of Menu.js, it only works for the id of menu1. I would say add something to initMenu to do the same thing for menu2.

You might also have a problem with the location of the script. You are including the script after menu1 is created but before menu2. So depending on when the window.onload happens this script might run before menu2 is created by the browser (I've had bad luck with trying to depend completely on onload events, and they are handled differently by each browser). You can sidestep the issue by deferring your javascript. For example:

<script type="text/javascript" src="/scripts/Menu.js" defer></script>

Let me know if this helps!
Copy linkTweet thisAlerts:
@aduk85authorMay 29.2008 — Thanks for that.

Im actually using to php includes to include the seperate menu's, and ive linked to the script like you posted above in both of those external php files.

How can i change the initmenu to make it work, i got so frustrated earlier after an hour trying to figure it out.

I know its simple but i just cant do it
Copy linkTweet thisAlerts:
@GSharpMay 29.2008 — The SG1 Captures section has id=menu2. The script you have included is only set to work for id=menu1. The id field has to be unique so you cannot rename both to be menu1. The non-elegant but simple solution would be to copy the code in the initMenu function to do the exact same thing it does for menu1 for menu2.

The elegant solution IMO would be to just rewrite your menu to already have the items that initMenu is adding. IE instead of getting the text nodes from the list and adding an href around it, just make the href in your php file that makes the menu.
Copy linkTweet thisAlerts:
@aduk85authorMay 29.2008 — Hey thanks, i tried using two different scripts both called menu1 and menu2, obviously using the relevant ones in each external php file and then linking accordingly, it didnt work unfortunately.

Im no pro with java and havent got a clue how to fix it or make it work. do you have any suggestions?
Copy linkTweet thisAlerts:
@GSharpMay 30.2008 — What exactly didn't work? Did you get any errors? Did you change the second script to use id=menu2? Where did you include the second script?
×

Success!

Help @aduk85 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...