This is a great script!Thanks.
The expand/contract buttons are very helpful, but the default contract doesn't seem to work for me.
Still, it defaults to expanded.Code:var contractall_default = true;
Any thoughts?
Thanks.
This is a great script!Thanks.
The expand/contract buttons are very helpful, but the default contract doesn't seem to work for me.
Still, it defaults to expanded.Code:var contractall_default = true;
Any thoughts?
Thanks.
Do you have persistence enabled as well directly above that line? If so the persistence takes precedence over the contract all feature. To confirm this, turn persistence off.
Actually it seems to me that to turn persistence off goes against the idea of wanting the menu to follow the user.Do you have persistence enabled as well directly above that line? If so the persistence takes precedence over the contract all feature. To confirm this, turn persistence off.
How about this...
Put the slash_contractall into the restore function. That way if the Menu cookie is null, it contracts the menu. If the Menu cookie is not null, it leaves persistance as it is.Code:function restore() { if(getcookie("menu") != null) { var hidden = getcookie("menu").split(","); for(var i in hidden) { titles[hidden[i]].className = "titlehidden"; submenus[hidden[i]].style.height = "0px"; submenus[hidden[i]].style.display = "none"; arrows[hidden[i]].src = "media/collapsed.gif"; } } else if (contractall_default) //DD added code slash_contractall() //DD added code }
Thoughts? This seems to work for me.
It's really a matter of preference and how you define "persistence". If the menu cookie is null, it actually means the user has chosen to have all menu items expanded. The persistence feature as is honors this, and the next time the page loads, all menu items are expanded.Put the slash_contractall into the restore function. That way if the Menu cookie is null, it contracts the menu. If the Menu cookie is not null, it leaves persistance as it is.
Thoughts? This seems to work for me.
This script is perfect, except for one minor flaw in my case. I'm trying to use it on multiple pages. Unfortunately, instead of looking for the cookie and replacing / updating it... it creates a new cookie every time you navigate to a new page with the navigation on it. Anyone have any ideas?
To make the persistence/ cookie site wide, find the line:
inside menu.js, and change that to:Code:document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate);
Code:document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";path=/; expires="+exdate);
dmurray14 asked for 2 improvements to slashdot - No1 is sorted great - but is any of you great minds working on No2 (contracting the previous menu item whenever a new menu item is opened?
I look forward to a new updated slashdot menu
Cheers
Originally Posted by dmurray14
Does anyone know what would cause this error?
"titles[hidden[i]] has no properties"
"Line 61 in menu.js"
From firefox.
Is it conflicting with another script on my site?
Basically, everything on the page loads, but the engines are still churning. The slashdot nav is un-usable for about 30 seconds, at which time the browser stops churning and the menu becomes expandable / contractable. Then the error above is goes into the javascript console log as an error.
Does the same thing in IE, but I've heard firefox errors are better.
Last edited by mgisonno; 08-01-2006 at 05:44 AM.
Hey all, i love the slashdot menu, unfortunately I seem to be having trouble with conflicting scripts. What i want to do is include a line of code in the body tag loading that will load both scripts at the same time.
Example:
SCRIPT 1: window.onload=dothis
SCRIPT 2: window.onload=dothat
RESOLUTION: <body onload="dothis();dothat()">
What ive come up with so far
<body onload="function(){enableTooltips("Content"); <---Need to know what to pull from the slashdot menu.js to put here --->">
Thanks for your help
Paul
Mitchepa:
Simply remove the line:
from menu.js, and add it to your BODY like so:Code:window.onload = init;
Code:<body onload="enableTooltips('Content'); init()" >
Bookmarks