 |
|
 |
MENU WITH DESCRIPTION -- NOT WORKING WHEN USED IN ASP.NET 2.0 MASTER PAGE
|
|
|
|
 |
|
 |
is there any solutions to work on firfox ??
Regards ,
|
|
|
|
 |
|
 |
you see the code is:if(objmenuMenu.style.display=="none") show();
else hide();
but if you replace the code "else" with
"if(objmenuMenu.style.display=="block") hide();" ,you will see that the first time you chick it ,it can't work exactly.
so where is the problem?I find that we do not know the value of style.display at first .In the DOM ,we can access it and change it ,but
we can't get the value,even use it to equal to string "block" and so on.
but this program work fine,because it's default value is none.
so...
|
|
|
|
 |
|
 |
anyone know hot to make this script work on firefox ?
let me know asap thx
|
|
|
|
 |
|
 |
Does anyone know how to do the same thing in ASP.NET (with VB.NET)?? Using the Code-Behind and HTML, without any Javascript. And is it possible to have the same collapsible thing if I load it from a database server?
What I want to do is to show a memberName as the title, and when I click on the expand/collapse button, it will display the member details (everything from SQL Server database) and two buttons; email and edit member.
Any help is appreciated. Please tell me if there are any links discussing this area.
Thanks.
|
|
|
|
 |
|
|
 |
|
 |
Very good menu..
But how can all the menu hide when page is loaded.
And then one can later open it.
Thanks
What you know today isn't enough for tommorow.
|
|
|
|
 |
|
 |
I was wondering if anyone has been able to get this to work with Netscape?
I saw the post below, but was wondering if it could be fixed?
Thanks...
|
|
|
|
 |
|
 |
Hi!
Thank for your code! It's very fine
But could you show me how I can auto hide all other menu when I click one?
Thank a lot
|
|
|
|
 |
|
 |
to auto hide an open menu, call the below method before the function ControlMenu(;
function HideAll()
{
for(var i=0 ; i < objSpanCollection.length ; i++)
{
objSpanCollection(i).childNodes(1).style.display = "none";
objSpanCollection(i).childNodes(1).childNodes(0).style.display = "none";
}
}
this method is also used to hide all menu items when the page loads initially.
Abhi
|
|
|
|
 |
|
 |
Is there a way to not display a description for some items? I tried not having text in the description div tag, but it still paints a thin blue line.
Thanks.
|
|
|
|
 |
|
 |
how can I show the active item, ie, in option menu item I want that appears with diferent font color or set borders the item that is in use.
How?
Thanks
Ruca
P.S. - Congratulations for your excelent code
|
|
|
|
 |
|
 |
Can u help me out making the menu maintain its state in all the pages.
For example
In page 1:
The user Collapses three of the total 5 menus. and go to page 2
IN page 2
IN page 2 it should dispaly in the same way as the user has left on page 1.
(3 menus collapsed and 2 open)
Hope u got my point
Can it be done using javascript cookies
Thanking you,
Fasil
|
|
|
|
 |
|
 |
imageUp = new Image();
imageUp.src = "images/up.gif";
imageDown = new Image();
imageDown.src = "images/down.gif";
var cnt;
var objSpanCollection;
var menuHeightCollection = new Array();
var objMenu;
//if the number of menus exceed more than 15 in ur page
//Change the value 15 in the for loop to the max u need.
if (!get_cookie('First')){
setcookie('First','T',1);
for (var i = 0; i < 15; i++)
{
if (i==0) {
setcookie(i,'O',1);
}
else {
setcookie(i,'C',1);
}
}
}
function getexpirydate( nodays){
var UTCstring;
Today = new Date();
nomilli=Date.parse(Today);
Today.setTime(nomilli+nodays*24*60*60*1000);
UTCstring = Today.toUTCString();
return UTCstring;
}
function get_cookie ( cookie_name )
{
var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );
if ( results )
return ( unescape ( results[1] ) );
else
return null;
}
function setcookie(name,value,duration){
cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration);
document.cookie=cookiestring;
if(!get_cookie(name)){
return false;
}
else{
return true;
}
}
function InitializeMenu()
{
/* get a collection of menus */
objSpanCollection = document.body.all.MainMenu.getElementsByTagName("SPAN");
for (var i = 0; i < objSpanCollection.length; i++)
{
var objSpan = objSpanCollection(i);
/* get a collection of Menus' height */
menuHeightCollection[i] = objSpan.childNodes(1).clientHeight;
objSpan.childNodes(0).childNodes(0).value = i;
objSpan.childNodes(0). önclick = ControlMenu;
}
for (var i = 0; i < objSpanCollection.length; i++)
{
if (get_cookie(i) == 'C'){
objSpanCollection(i).childNodes(1).style.display = "none";
objSpanCollection(i).childNodes(1).childNodes(0).style.display = "none";
}
}
}
function ControlMenu()
{
cnt = 1;
objMenu = this.parentNode.childNodes(1); /* memorize the Menulist has been clicked */
var val;
val = this.parentNode.childNodes(0).childNodes(0).value;
var objArrow = this.childNodes(0).childNodes(0).childNodes(0).childNodes(1).childNodes(0);
if (objMenu.style.display == "none")
{
objArrow.src = imageDown.src; /* change to the Down Arrow */
setcookie(val,'O',1);
ShowMenu();
}
else
{
objArrow.src = imageUp.src; /* change to the Up Arrow */
setcookie(val,'C',1);
HideMenu();
}
}
function ShowMenu()
{
var objList = objMenu.childNodes(0); // get the Linkslist of the Menulist
if (cnt < 10)
{
// display the Menulist
objMenu.style.display = "block";
// increase the tranparency of the Menulist
objMenu.filters["alpha"].opacity = objMenu.filters["alpha"].opacity + 10;
// loop through the Menu collection to find the position of the clicked Menu
// to get the actual height of the menu list and then increase the height of the Menulist
for (var i = 0; i < objSpanCollection.length; i++)
if (objMenu.parentNode == objSpanCollection[i])
objMenu.style.height = objMenu.clientHeight + (menuHeightCollection[i]/10);
cnt++;
// do this function again after 30 miliseconds until the actual Menulist's height is returned
setTimeout("ShowMenu()",30)
}
// display the Menulist if the it's actual height is returned
if (cnt >= 10)
{
for (var i = 0; i < objSpanCollection.length; i++)
if (objMenu.parentNode == objSpanCollection[i])
objMenu.style.height = menuHeightCollection[i];
objList.style.display = "block";
}
}
function HideMenu()
{
var objList = objMenu.childNodes(0); // get the Linkslist of the Menulist
if (cnt < 10)
{
objMenu.filters["alpha"].opacity = objMenu.filters["alpha"].opacity - 10;
for (var i = 0; i < objSpanCollection.length; i++)
if (objMenu.parentNode == objSpanCollection[i])
if (objMenu.clientHeight > menuHeightCollection[i]/10)
objMenu.style.height = objMenu.clientHeight - (menuHeightCollection[i]/10);
objList.style.display = "none";
cnt++;
setTimeout("HideMenu()",30)
}
if (cnt >= 10)
{
objMenu.style.height = 0;
objMenu.style.display = "none";
}
}
// I have tested it. ITs is working fine...... Plz help me out if u find any
// bugs..
//Thank you,
//fasil
|
|
|
|
 |
|
 |
Hi.
I downloaded this excellent menu and first watched it on IE6 and everything went ok, but when I openend on NS7 the menu was completly static (it couldn't hide).
Is there a way this menu be availabe also in Netscape, at least NS7?
Please tell me if so.
Thanx in advance.
|
|
|
|
 |
|
 |
To make it work with Nescape and IE, alot of code need to be changed (but I'm not very sure it will work). Because the way Netscape handle the stylesheet is different, but the idea is the same.
|
|
|
|
 |
|
 |
so basically, it's useless then
|
|
|
|
 |
|
 |
Hi
I'd like to know how to set this menu up in order to load on a default expanded menu
for example if user is currently in page3 then get
page1
page2
page3
submenu1
submenu2
submenu3
page4
and if the user goes to page 2 then get
page1
page2
submenu1
submenu2
submenu3
page3
page4
How can I do that?
thanx.
|
|
|
|
 |
|
 |
Hi, U can see this, this might help u out
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> Drop Down Menu </TITLE> </HEAD> <BODY> <style> dl#menu { filter:progid:DXImageTransform.Microsoft.Gradient( GradientType=1,StartColorStr=#999480, EndColorStr=#DBDBDB); width: 125px; list-style-type: none; border-top: solid 1px #b9a894; border-left: solid 1px #b9a894; border-right: solid 1px #b9a894; background-color: #CCFFFF; color: #FFFFCC; margin: 0; cursor: hand; padding: 0; border-bottom:solid 1px #222222; width:90%; } dl#menu ol { display: none; text-align: left; background-color: #FFFFFF; list-style-type: none; margin: 0; padding: 5px; } dl#menu li, dl#menu a { font-family: verdana, sans-serif; font-size: 13px; color: #0000FF; } dl#menu li { border-bottom: solid 1px #b9a894; line-height: 15px; } dl#menu ol li { border-bottom:none; margin ;padding ;overflow:auto; } dl#menu ol li:before { content: "- "; } dl#menu a { text-decoration: none; outline: none; color: #000000; } dl#menu a:hover { color: #0000FF; text-decoration: underline; } dl#menu a.active { color: #0000FF; } </style> <script type="text/javascript"> if(!window.Node){ var Node = {ELEMENT_NODE : 1, TEXT_NODE : 3}; } function checkNode(node, filter){ return (filter == null || node.nodeType == Node[filter] || node.nodeName.toUpperCase() == filter.toUpperCase()); } function getChildren(node, filter){ var result = new Array(); var children = node.childNodes; for(var i = 0; i < children.length; i++){ if(checkNode(children[i], filter)) result[result.length] = children[i]; } return result; } function getChildrenByElement(node){ return getChildren(node, "ELEMENT_NODE"); } function getFirstChild(node, filter){ var child; var children = node.childNodes; for(var i = 0; i < children.length; i++){ child = children[i]; if(checkNode(child, filter)) return child; } return null; } function getFirstChildByText(node){ return getFirstChild(node, "TEXT_NODE"); } function getNextSibling(node, filter){ for(var sibling = node.nextSibling; sibling != null; sibling = sibling.nextSibling){ if(checkNode(sibling, filter)) return sibling; } return null; } function getNextSiblingByElement(node){ return getNextSibling(node, "ELEMENT_NODE"); } // Menu Functions & Properties var activeMenu = null; function showMenu() { if(activeMenu){ activeMenu.className = ""; getNextSiblingByElement(activeMenu).style.display = "none"; } if(this == activeMenu){ activeMenu = null; } else { this.className = "active"; getNextSiblingByElement(this).style.display = "block"; activeMenu = this; } return false; } function initMenu(){ var menus, menu, text, a, i; menus = getChildrenByElement(document.getElementById("menu")); for(i = 0; i < menus.length; i++){ menu = menus[i]; text = getFirstChildByText(menu); a = document.createElement("a"); menu.replaceChild(a, text); a.appendChild(text); a.onclick = showMenu; a.onfocus = function(){this.blur()}; } } if(document.createElement) window.onload = initMenu; </script> <h3><FONT COLOR="#6600FF" face="Verdana"> Please Click on the desired Menu </h3></FONT> <dl id="menu"> <li>Menu Item 1 <ol> <li><a href="http://www.google.com" target="content"> Goolgle Search </a></li> </ol> </li> <li>Menu Item 2 <ol> <li><a href="http://www.msn.com" target="content"> MSN Search </a></li> </ol> </li> <li>Menu Item 3 <ol> <li><a href="http://www.yahoo.com" target="content"> Yahoo Search </a></li> </ol> </li> <li>Menu Item 4 <ol> <li><a href="http://www.rediff.com" target="content"> Rediff Search </a></li> </ol> </li> </dl> </BODY> </HTML>
Keertikiran
|
|
|
|
 |
|
 |
trying to add this type of menu in a frame. but having dificulty with the descriptions slipping under the frame to the rigth. does any body know how to get the description show up above the frame.
thanks
|
|
|
|
 |
|
 |
I have the same question...
Did you get a solution for this?
|
|
|
|
 |
|
|
 |
|
 |
I was thinking of doing a menu system similar to this for a client. If you don't mind me using it, it would save a lot of time on my part
********************
* SteveMcLenithan
* steve@steve-mac.com
* http://steve-mac.com
********************
|
|
|
|
 |
|
 |
If you click on the expand/collapse button whilst the panel is in the process of expanding the panel grows in size, resulting in extra blank space at the foot of the panel.
To replicate the problem, click rapidly on the expand/collapse button of a panel.
Nice code otherwise. Cheers.
--
The Obliterator
|
|
|
|
 |
|
 |
Tried to trap doubleclick, but didnt work...
starting to think the height must be defined in some contastant variable and have the show-function stop any expanding when height of element reaches this constant value...
without any decent bugfix, this script is crap imo...
------------------------------------------
Hey! Stop reading my signature... stop it!
hmm... you're still reading it...
|
|
|
|
 |