JavaScript - creating drop down menu bar

Asked By waseem kaleem
19-Jul-10 02:04 AM
Can anybody tells me how can i create dropdown menu bar in html?
  Sasha Kotlo replied to waseem kaleem
19-Jul-10 02:26 AM
Yes it's easy. You would use html combined with CSS to do it. Here's a good tutorial on the subject:

http://ago.tanfa.co.uk/css/examples/menu/tutorial-v.html#vstart

Regards.
  waseem kaleem replied to Sasha Kotlo
19-Jul-10 01:37 PM
I know CSS very little.I doesnot know what will these tags "#menu h2" and "#menu ul ul ul" perform? #menu define new data type? 
  Sasha Kotlo replied to waseem kaleem
19-Jul-10 04:58 PM
CSS is quite an intuitive language..lets take the things you mentioned and let me explain you what they mean:

#menu h2

when you create an html element on the page you can give it an id like the following:

<div id="menu">

</div>

elements in CSS can be accessed either by using their IDs, class names (ill explain that in a bit as well) and also by element types (p, div, a, ul, etc). So basically what #menu h2 means is the following:

get the element which ID is menu (notice that by saying #menu alone you will get any element with ID of menu). You can also specify that you want to select only div elements with ID menu which is done as following:

div#menu

so this code will select a div on page which has an ID attribute set to menu.

Now further on by separating elements in CSS this is what happens:

#menu h2

what this code does is following. Get the element on the page whose ID is menu and select an h2 element inside of it and apply the following layout rules (this is inside the parenthesis).. So something like this:

#menu h2
{
color: #000; /* Sets the font color of the h2 element to black */
font-size: 24px; /* self-explanatory */
font-style: italic; /* set the style of the font to be italic letters */
}

Anyways to learn more you can visit the official website of WC3 and read the basics of CSS.. If you're to start learning web developing CSS is a must known tool and everyone, absolutely everyone you ever work for will demand you to have good knowledge of it.

http://www.w3schools.com/Css/default.asp

Best of luck,
Regards.
  waseem kaleem replied to Sasha Kotlo
21-Jul-10 12:06 PM
i am sorry.Can you differentiate these two difinitions with examples ul#menu and #menu ul?
  Sasha Kotlo replied to waseem kaleem
21-Jul-10 12:12 PM
Yes of course. First:

ul#menu is referencing an ul element whose id is set to menu like this:

<ul id="menu">

</ul>

as for #menu ul it means get the ul element inside any element which is named menu like for example:

<div id="menu">
<ul>

</ul>
</div>

or

<p id="menu">
<ul>

</ul>
</p>

Hope that helps you.

Regards.
  waseem kaleem replied to Sasha Kotlo
22-Jul-10 12:51 PM

Thank you very much for replies.
#stl tr.w td
it means gets element td whose id is stl and class is w.if anyone of them is miss then style is not implement.I define this correct or not. I has learnt all this for creating drop down menu.i can create different boxex.but idoesnot create successfully.Sir can you provide me an article about creating drop down menu using CSS and java?

Thanks

  Sasha Kotlo replied to waseem kaleem
22-Jul-10 12:56 PM
You don't need to use Javascript at all. In fact CSS is more reliable for a menu than javascript. as for #stl tr.w td you understood wrong. Read it left from right, not right to left.

#stl - get an element whose id is stl
tr.w - find a tr element (with class set to w) inside the #stl element
td - find a td element inside tr with class w which is also inside the #stl element

Hope that helps you.

Regarding the tutorial here is one done using CSS:

http://www.alistapart.com/articles/horizdropdowns/

Regards.
  Sasha Kotlo replied to Sasha Kotlo
22-Jul-10 12:56 PM
pardon me, typo error:

Read it left TO right, not right to left.
Create New Account
help
How can we know a state of a thread? (A) What is use of Interlocked class ? (A) What is a monitor object? (A) What are wait handles? (A) What is ManualResetEvent and Webservices (B)What is an application domain? (B) What is .NET Remoting? (B) Which class does the remote object has to inherit? (I) what are two different types of remote Cache substitution? Chapter 6: OOPS (B) What is Object Oriented Programming? (B) What is a Class? (B) What is an Object? (A) What is the relation between Classes and Objects? (B Overriding? (I) what is the difference between delegate and events? (B) If we inherit a class do the private variables also get inherited? (B) What is the different accessibility levels defined in .NET? (I) Can you prevent a class from overriding? (I) what is the use of “Must inherit” keyword in VB.NET? (I Do interface have accessibility modifier. (A) What are similarities between Class and structure? (A) What is the difference between Class and structure’s? (B) What does virtual keyword mean? (B) What are shared (VB.NET 9: ADO.NET (B) What is the namespace in which .NET has the data functionality class? (B) Can you give an overview of ADO.NET architecture? (B) What are the two
cannot be used with indexers, destructors, or types. In C#, the static keyword indicates a class variable. In VB, the equivalent keyword is Shared. Its scoped to the class in which it occurs. Example a. Static int var / / in c#.net b. static void edit the page level debugging enable the trace to true in the line in the html format of the page. %@ Page Language = ”vb” trace = ”true”AutoEventWireup = ”false” Codebehind = ”WebForm1.aspx.vb cookies Tell few steps for optimizing (for speed and resource) ASP page / application. Avoid mixing html code with asp code Which command using Query Analyzer will give you the version of theory this allows very tight interop between different .NET languages - for example allowing a C# class to inherit from a VB class. • 07. What is IL? • Ans : IL = Intermediate Language. Also known as MSIL (Microsoft Intermediate Language to in the context of Managed Extensions (ME) for C++. When using ME C++, a class can be marked with the _ _gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector, but it also means more than that. The class
VBA now has a true pointer data type called longPtr. We also get a 64 bit wide data type called longlong. There is a few new compiler definitions, and of course we get a 64 bit version of the jet engine (now since 2007 called ACE - for the remainder this article Note that this new version of VBA of course is also runs on the 32 bit version of windows. -> Database triggers and stored procedures: New for 2010 in jet is table switch to 64 bits would have been seamless - all well, when we jump to 128 bit computers, Access and VBA will be ready because we now have a true pointer data would anyway! The same thing goes for the table triggers. Table trigger makes a whole class of problems really easy to solve. So the lesser developer wins because the problem is the triggers and procedures we have at the table level in jet are quite a bit different, and they not like t-sql, or Oracles pl / sql or even whatever mySql of a new version of VBA so much as porting it to work in 64-bit environments? I mean, I have not read of any new features other than the two and the LongPtr and LongLong variable types. Yes? I have been collecting links on 64-bit Access in my Access bookmarks file. Here they are, to assist others in figuring it
abstract class and interface What is abstract class and interface ? What is diffrence between them ? And in what instance we use abstract class and interaface . Please give some live exmple Hi, The most real time example of abstract class and interface is bulding a house , you create a class say House and then another say Shop both extend Building but you decide to make Building as an abstact class as when you create an object of the building class you don't know which kin of object it will be; will it be house or shop so the program fails and you say ah it is good that this class is made an abstract as we shouldn't create an object of this class. Interface
hold to give a = short comment on them: Using static classes to purely use another class's fields and methods to = even pretend being a member of that other class without actually being a = member of that class is very hard to understand. It compromises any = refacturing effort. Who invents such things. . .? OOD pobox.com> http: / / www.pobox.com / ~skeet Blog: http: / / www.msmvps.com / jon.skeet World class .NET training in the UK: http: / / iterativetraining.co.uk On Sat, 29 Mar 2008 15 hold to give a short comment on them: Using static classes to purely use another class's fields and methods to even pretend being a member of that other class without actually being a member of that class is very hard to understand. It compromises any refacturing effort. Who invents such things. . .? OOD with colleagues about using them. If I tell them to keep = member functions within a class instead of creating some function = anywhere, providing an object as a parameter, doing nothing else