473,883 Members | 2,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query regarding collapsible Menu

50 New Member
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="EditPl us">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Descripti on" CONTENT="">
<style>
<!--
#foldheader{cur sorointer;curso r:hand ; font-weight:bold}


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

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


var ns6=document.ge tElementById&&! document.all
var ie4=document.al l

function checkcontained( e)
{
var iscontained=0
cur=ns6? e.target : event.srcElemen t
i=0
if (cur.id=="foldh eader")
iscontained=1
else
while (ns6&&cur.paren tNode||(ie4&&cu r.parentNode))
{
if (cur.id=="foldh eader"||cur.id= ="foldinglis t")
{
iscontained=(cu r.id=="foldhead er")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentNode
}

if (iscontained)
{
var foldercontent=n s6? cur.nextSibling .nextSibling : cur.all.tags("U L")[0]
if (foldercontent. style.display== "none")
{
foldercontent.s tyle.display=""

}
else
{
foldercontent.s tyle.display="n one"

}
}
}

if (ie4||ns6)
document.onclic k=checkcontaine d

//-->
</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">CN N</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.dynamicdriv e.com">Dynamic Drive</a></li>
<li><a href="http://www.javascriptk it.com">JavaScr ipt Kit</a></li>
<li><a href="http://www.freewarejav a.com">Freeware java.com</a></li>
</ul>

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

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


Thanks in advance.
Jan 17 '08 #1
2 2192
harshmaul
490 Recognized Expert Contributor
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
onlymukti4u
50 New Member
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
6187
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 would also be cool. This does not need to be cross-browser as I am thinking basically about replacing/hacking some built in displays of Explorer by using its html display capabilities. Using Javascript to do it will raise security errors, but css...
5
5868
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 users to click on another category and have that expand). Example:
1
1325
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 back in place if you either 1.click on the main link again (STAFF in example 1)or 2. if you click on a different main link(STAFF, CAREERS or INTERNSHIP) (i think you know what i am talking about – just a boring moving menu) example 1
0
1608
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 functionality by extending or do I have to build an entirely new control. Please suggest. Madhur
7
2690
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 menu then hide it again ... haven't found anything that allows erasing or rewriting ... Thanks.
1
1522
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 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...
1
1651
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 can any one help me plz. My requirement is I am having different A's. Under each A Can have different B's. For each B can have diffrent C's.
1
1176
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 "-//W3C//DTD HTML 4.01 Transitional//EN"> in top, but when I am using Mozilla to open this it is showing problems like the background images not coming properly as well as texts are getting overlapped. Hope anyone have come across this problem and have...
0
9953
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9799
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10868
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9591
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5808
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6009
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.