Simple question but not sure of answer

S

sean.stonehart

I've got a menu written in Javascript I'm wanting to enable but I need
for it to sit in the center of a 3 column table. The menu keeps
anchoring itself to the top left of the display, which is not what I
had in mind.

I'm new to writing Javascript & enabling it in this manner. Any
suggestions on how to make it respond to the HTML I'm wrapping around
it would be great.

Thanks!
 
R

RobG

I've got a menu written in Javascript I'm wanting to enable but I need
for it to sit in the center of a 3 column table. The menu keeps
anchoring itself to the top left of the display, which is not what I
had in mind.

I'm new to writing Javascript & enabling it in this manner. Any
suggestions on how to make it respond to the HTML I'm wrapping around
it would be great.

Have it use the DOM to position itself based on your chosen element.
You'll have to wait for the page to load though, so it may appear in
one place, then later move to your desired place - or not.
 
S

sean.stonehart

Have it use the DOM to position itself based on your chosen element.
You'll have to wait for the page to load though, so it may appear in
one place, then later move to your desired place - or not.

Ok cool... one more question from the newb... is that the HTML DOM or
Javascript DOM?
 
L

-Lost

Ok cool... one more question from the newb... is that the HTML DOM or
Javascript DOM?

Um, unless I am mistaken, there is sorta no such thing as "JavaScript DOM." That is, only
XML, HTML, and similar marked up documents create a DOM.

JavaScript is merely one method by which to interface and traverse said documents.

Then again, I suppose some may argue that "JavaScript DOM" is an implementation of
JavaScript and DOM. *shrugs*

http://developer.mozilla.org/en/docs/Gecko_DOM_Reference:Introduction#DOM_and_JavaScript

Funny though, DOM JavaScript does exists if we define it as JavaScript that traverses the
DOM and/or utilizes DOM methods.

Hrmm... I think I got all that right. Been drinking again... could be wrong.

-Lost
 
S

sean.stonehart

Um, unless I am mistaken, there is sorta no such thing as "JavaScript DOM." That is, only
XML, HTML, and similar marked up documents create a DOM.

JavaScript is merely one method by which to interface and traverse said documents.

Then again, I suppose some may argue that "JavaScript DOM" is an implementation of
JavaScript and DOM. *shrugs*

http://developer.mozilla.org/en/docs/Gecko_DOM_Reference:Introduction...

Funny though, DOM JavaScript does exists if we define it as JavaScript that traverses the
DOM and/or utilizes DOM methods.

Hrmm... I think I got all that right. Been drinking again... could be wrong.

-Lost- Hide quoted text -

- Show quoted text -

Ok... my bad for mistyping.

Is there somewhere I've not found on the web or an example that
somebody might be willing to share to give me an idea of how to do
this? I'm using the script from a library & I've never really gotten
into the DOM for doing stuff.

My code problem for all intents & purposes looks like this:

<table width="100%" border="1" cellspacing="0" cellpadding="1">
<tr>
<td>Left side stuff</td>
<td><script src="../_scripts/hrz_menu.js"></script></td>
<td>Right side stuff</td>
</tr>
</table>

Thanks in advance!
 
R

RobG

Is there somewhere I've not found on the web or an example that
somebody might be willing to share to give me an idea of how to do
this? I'm using the script from a library & I've never really gotten
into the DOM for doing stuff.

What you are trying to do requires HTML and CSS. These languages are
used by a browser to build a document object model (DOM) of elements
with attributes. If you get the elements and their attributes right,
you will have a menu in the center of a three column table.

Once you work out how to build the DOM you want using HTML and CSS, you
might then be ready to start modifying it using script and the DOM API
described by the various W3C DOM specifications.

Javascript is just another way of building and modifying the same DOM.
It doesn't have any special power to position or modify elements other
than those provided by HTML and CSS.

My code problem for all intents & purposes looks like this:

<table width="100%" border="1" cellspacing="0" cellpadding="1">
<tr>
<td>Left side stuff</td>
<td><script src="../_scripts/hrz_menu.js"></script></td>
<td>Right side stuff</td>
</tr>
</table>

If you want help with HTML and CSS, start with a tutorial, there are
thousands on the web. Expect to be told lots of rubbish, so use groups
dedicated to those technologies to answer questions:

HTML: comp.infosystems.www.authoring.html

CSS: comp.infosystems.www.authoring.stylesheets


For javascript, you can start with <URL:http://www.w3schools.com>,
though like any other tutorial they preach their fair share of rubbish.
Stay open minded and skeptical, ask questions here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top