/    Sign up×
Community /Pin to ProfileBookmark

Trouble with CSS Menu – shared html page

I’m using a css menu with 6 main tabs, and various sub pages under each tab.
each page has a class in the body tag like this – <body class=”tab1″….> – so that the tab in which the page was found is highlighted
The problem I’m having is that I have a sub page that is found under TWO different main tabs
Is there a way I can add some sort of if else statement of sorts to let the page know which main tab the user came from??

thanks in advance for any and all help

P

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@pollyauthorJun 21.2005 — In case anyone encounters the same problem, here's my solution:

I set a parameter on the actual href coming from the menu tab2 - "blahblah.html?main_tab=tab2"

then I added the following to the page itself

<body class="<%= request.getParameter("main_tab") == null ? "tab1" : "tab2" %>"

now when blahblah.html is accessed from tab1, or tab2, the menu displays correctly
×

Success!

Help @polly 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 6.1,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...