473,395 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Query regarding collapsible Menu

Hi,

I am facing a problem for the allignment of the submenus under same line with the menu. Actually after clicking the menus the submenus should come exactly under same line with the menu but it is coming with some space.Can anyone help me in this regard. I am giving the total html code below which contains the javascript too.

Code:-

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style>
<!--
#foldheader{cursorointer;cursor:hand ; font-weight:bold}


//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use


var ns6=document.getElementById&&!document.all
var ie4=document.all

function checkcontained(e)
{
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentNode))
{
if (cur.id=="foldheader"||cur.id=="foldinglist")
{
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentNode
}

if (iscontained)
{
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none")
{
foldercontent.style.display=""

}
else
{
foldercontent.style.display="none"

}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>
</HEAD>

<BODY>
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a href="http://www.freewarejava.com">Freewarejava.com</a></li>
</ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">outer 1</a></li>
<li><a href="http://www.dynamicdrive.com">outer 2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">nested 1</a></li>
<li><a href="http://www.dynamicdrive.com">nested 2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li>
<li><a href="http://www.dynamicdrive.com">outer 4</a></li>
</ul>
</ul>

</font>
</BODY>
</HTML>


Thanks in advance.
Jan 17 '08 #1
2 2160
harshmaul
490 Expert 256MB
hi
add this style
Also you need to validate yout code you've got many IDs all over the place. use classes if there is more than one


Expand|Select|Wrap|Line Numbers
  1. #foldinglist{
  2. margin-left:0px;
  3. }
Jan 28 '08 #2
Thanks Man...It worked now.

Appreciated.

Thanks & Regards,
Mukti

hi
add this style
Also you need to validate yout code you've got many IDs all over the place. use classes if there is more than one


Expand|Select|Wrap|Line Numbers
  1. #foldinglist{
  2. margin-left:0px;
  3. }
Jan 29 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: pantagruel | last post by:
Hi, I'm wondering if CSS support in IE is such that one could make an expandable collapsible vertical menu - such as in a TOC - without using Javascript that will work in at least IE 6. IE 5...
5
by: Jonathan | last post by:
Hello All, I am in the process of creating a 2/3 level collapsible/exspanible menu (called "nav") where users can click on a category and have the submenus appear beneath it and so on (allow...
1
by: leahleah | last post by:
hi, i am a beginner when it comes to javascript, i would like to have a menu (see examples 1 and 2 below), that folds out to reveal sub links, pushing the other menu items down – and then springs...
0
by: madhur | last post by:
Hello I am trying to build a collapsible menu control similar to oen in http://rsa.com. I want to know, If I can extend the ASP.NET 2.0 Menu control for this purpose. Can I achieve that...
7
by: David T. Ashley | last post by:
I'm trying to implement these ... I know there is a lot of example code on the web, but I'm trying to roll my own ... What JavaScript functionality is typically used to display parts of the...
1
by: onlymukti4u | last post by:
Hi, I am facing a problem for the allignment of the submenus under same line with the menu. Actually after clicking the menus the submenus should come exactly under same line with the menu but it...
1
by: mahesh123 | last post by:
I am using Collapsible Panel in my project.But in other form of my project i want to use collapsible panel inside other Collapsible panel.Is it possible. Both panels are to be dinamic.Is it possible...
1
by: onlymukti4u | last post by:
Hi, I am facing a problem in my page which consists of a left collapsible menu. It is working fine for IE6 and with CSS hacks it is working fine for IE7 with adding <!DOCTYPE HTML PUBLIC...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.