473,396 Members | 1,768 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,396 software developers and data experts.

Simple question but not sure of answer

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!

Apr 11 '07 #1
5 1180
On Apr 11, 12:03 pm, sean.stoneh...@gmail.com wrote:
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.
--
Rob

Apr 11 '07 #2
On Apr 10, 10:28 pm, "RobG" <r...@iinet.net.auwrote:
On Apr 11, 12:03 pm, sean.stoneh...@gmail.com wrote:
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.

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

Apr 11 '07 #3
<se************@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
On Apr 10, 10:28 pm, "RobG" <r...@iinet.net.auwrote:
>On Apr 11, 12:03 pm, sean.stoneh...@gmail.com wrote:
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.
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...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
Apr 11 '07 #4
On Apr 11, 7:26 am, "-Lost" <missed-s...@comcast.netwrote:
<sean.stoneh...@gmail.comwrote in message

news:11**********************@p77g2000hsh.googlegr oups.com...


On Apr 10, 10:28 pm, "RobG" <r...@iinet.net.auwrote:
On Apr 11, 12:03 pm, sean.stoneh...@gmail.com wrote:
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.
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...e: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!
Apr 11 '07 #5
se************@gmail.com wrote:
[...]
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.
--
Rob
Apr 11 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Matthew Thorley | last post by:
My friend sent me an email asking this: > I'm attemtping to decide which scripting language I should master and > was wondering if it's possible to do > these unixy awkish commands in python:...
4
by: Owen Parker | last post by:
Hi all I am not a java programmer but i can hack at it a bit. I am trying to allow a user to define the text in a simple javascript text scroller. The data is stored as multiple records in a...
6
by: SB | last post by:
This while loop keeps repeating even when a correct character is entered.... cout<<endl<<"What day would you like to schedule the appointment?"<<endl; cout<<endl<<"Enter 'M' for Monday, 'T' for...
51
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct...
11
by: Geagleeye | last post by:
Hi, Im a rookie in vba, and therefor got a problem. i do have folwing records F G --------------- 2 3 2 5 6 7
0
by: Greg Corradini | last post by:
Hello all, I'm having trouble inserting an SQL selection into a new MS Access table. I get a parameter error on my insert statement when I try this (see below for code and error msg). I'm not sure...
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
7
by: call_me_anything | last post by:
Is char abc different from char abc ?
2
by: John | last post by:
Hi not sure were to post this but would appreciate if someone knows simple answer...... which usually never exists hi have added all my items subitmes and colors etc to my listview1 in vb...
5
by: Oriane | last post by:
Hi, With Asp.net 2.0, when a internet user logs in with a "login authentication form", is the password encrypted when it is sent to the server ? Is is hashed ? Best regards
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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.