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

Problem positioning a layer, please advise.

I am making a custom small menu which is most basic. Problem is that I can't
make the first step work for some reason.

I have an image to the left of where would be the layer positioned. This
layer must be 15 pixels to the left of that image.

Since my main page is centered in the browser's window, the pixels to the
left of my image are different for each browser and also depends on how wide
the browser window is.

This is my stupid code that has a function that is called in BODY onload:
<SCRIPT LANGUAGE="JavaScript">function PosLayer() {
pic=document.getElementById("Picture");
layer=document.getElementById("Layer");
layer.style.left=parseInt(pic.style.left) + 15; }</script>Someone said that
image has no ".style.left" property, I don't know if it is true.If it is,
how would I go about positioning the layer where I want relative to some
other object?Thank you very much, somehow my books on Java script don't
describe this well. Please advise me, thank you again.
Jul 20 '05 #1
1 1470
you can do this using css; make your image positioned RELATIVE to your layer;
you'll need to align your html elements the right way.
<div id="layer">
layer stuff here
<div id="image"><img src </div
</div>

Then set the left: ; and top: ; coordinates accordingly. email me with a
url and i'll take a peek at it and see if it's doable.

Jim
Jul 20 '05 #2

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

Similar topics

9
by: Jerry | last post by:
Hi People ! I have an Urgent Problem and greatly appreciate your help: My script sends multipart emails using the MAIL_MIME package from pear.php.net Works great so far but..... ...
4
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following...
2
by: kevinC | last post by:
Hello, I know most of you are probably going seeing positioning:absolute; and centering in the title and saying, oh no! not again! Do a google search! Actually, I've found many helpful...
8
by: rdlebreton | last post by:
Hi, Folks! I've been trying to develop my own version of these draggable layers and I have been limiting myself to IE6...for now. I have looked at some other examples to get ideas of creating...
4
by: Richard | last post by:
Hi, I like a demo on layers posted at http://www.echoecho.com/csslayers.htm. It displays two text phrases in separate layers visually overlapped, first with one on top and the other beneath,...
2
by: nino9stars | last post by:
Hello, I have just started messing with absolute positioning on webpages, and it definitely let's you do some creative things. Well, after much searching and help, I got the images I was using...
2
by: TheCruelPanda | last post by:
Hey there. My name is Rowan, and it's been three weeks since I last used tables for an HTML design. Okay, I'm rather new to CSS and I have a big positioning problem here. It might not be a...
3
by: vunet | last post by:
When I use image as a bullet within LI element I have different image positioning results in Firefox and IE6. IE6 puts the image on top and far from left LI's border. Firefox puts it nicely in the...
2
by: scdowney | last post by:
First and foremost, thank you in advance for any attempts to help me out. I am working on a project with work, and it requires I use CSS selectors to locate elements within a webpage. For the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.