PDA

View Full Version : slashdot menu issue



Malatest
11-08-2012, 12:54 PM
1) Script Title: Slashdot Menu issue

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/slashdot.htm

3) Describe problem: Menu works perfectly when testing on personal computer. Does not work the way I want it to upon uploading it to the server. I've discovered that it's a cookie issue. When I turn cookies off in IE8 and google chrome, the menu works perfectly. But I don't want the end user to have to turn off their cookies everytime they visit our site. Also, by turning cookies off while viewing our website, if I am surfing under a separate tab in the browser, having cookies turned off affects all other websites under each tab of the browser. Sucks if I'm multitasking.

Here's how I have it programmed. For each asp file (luncheons, agm, ufe-dates, etc.) below under the first category (Upcoming events), the programming is as follows:

HTML Code:


<div align="left" class="expand">
<span>Upcoming Events</span>
<a href="luncheons.asp">Council Meetings/Member Lunches</a>
<a href="agm.asp">Annual General Meeting</a>
<a href="ufe-dates.asp">UFE Dates</a>
<a href="convocation.asp">Convocation</a>
<a href="upcoming.asp">Professional Development</a>

</div>
<div align="left" class="collapsed">
<span>Professional Opportunities</span>
<a href="employment.asp">Employment Opportunities</a>
<a href="volunteer.asp">Volunteer Opportunities</a>
<a href="http://www.casource.com/" target="_blank">CA Source</a>
<a href="http://www.directorssource.com/" target="_blank">Directors Source</a>

</div>

Under professional opportunities, all asp files have this coding:

HTML Code:
<div align="left" class="collapsed">
<span>Upcoming Events</span>
<a href="luncheons.asp">Council Meetings/Member Lunches</a>
<a href="agm.asp">Annual General Meeting</a>
<a href="ufe-dates.asp">UFE Dates</a>
<a href="convocation.asp">Convocation</a>
<a href="upcoming.asp">Professional Development</a>

</div>
<div align="left" class="expand">
<span>Professional Opportunities</span>
<a href="employment.asp">Employment Opportunities</a>
<a href="volunteer.asp">Volunteer Opportunities</a>
<a href="http://www.casource.com/" target="_blank">CA Source</a>
<a href="http://www.directorssource.com/" target="_blank">Directors Source</a>

</div>

So basically, if I choose "convocation.asp" that menu remains expanded while category "Professional Opp" remains collapsed. I can then open the prof. opp category and choose "volunteer.asp", the page loads and the "Upcoming Events" is collapsed while the Prof opp category is expanded. It remains expanded as I continue to choose files from the submenu - until I choose something under a different category. I hope what I'm saying is a good explanation of what's happening. This works perfectly on my computer but cookies are affecting how it behaves on the server.

Is there a way around this (some kind of code) I can incorporate into the asp files that will fix this problem? I've googled the issue endlessly for a few days now and I can't find a solution. I know there is code that you can change in the js file that will automatically turn off cookies when someone visits our site. But I think that would also affect any other websites that the user is visiting under a different tab in the browser. Also, I tried the change this.remember = true; to false, (as one person suggested) but that didn't make a difference.


function SDMenu(id) {
if (!document.getElementById || !document.getElementsByTagName)
return false;
this.menu = document.getElementById(id);
this.submenus = this.menu.getElementsByTagName("div");
this.remember = true;
this.speed = 3;
this.markCurrent = true;
this.oneSmOnly = false;

Does anyone have any fixes? I would appreciate. If you require a link to the website to view it in action, please let me know. Thanks!

ddadmin
11-15-2012, 08:54 PM
Hmm while it's unlikely the cause is a conflict between the Slashdot menu's cookie name and your other scripts', just to rule it out, try changing the code in red below inside sdmenu.js to something else:


document.cookie = "sdmenu_" + encodeURIComponent(this.menu.id) + "=" + states.join("") + "; expires=" + d.toGMTString() + "; path=/";

such as _slashdotmenu. If that doesn't work, try also deleting the "path=/" part in bold above. Finally, please post a link to the problem page.