473,756 Members | 5,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="JavaS cript">function PosLayer() {
pic=document.ge tElementById("P icture");
layer=document. getElementById( "Layer");
layer.style.lef t=parseInt(pic. style.left) + 15; }</script>Someone said that
image has no ".style.lef t" 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 1488
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"><im g 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
2284
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..... ....Sometimes (depending on the mail server that handles the mailing) all quotation marks in an HTML body of a multipart message become escaped.
4
3844
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 beautiful script "http://javascript.internet.com/navigation/toolbar-menu.html". It works like a charm. I made my webpage in frames, where the nav-frame shows the menubar, so whenever I click a link in the menubar, it opens in the frame below. But...
2
2610
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 resources online and realize that my case may be a bit more challenging. I'm trying to create a table-less layout that looks something like:
8
2568
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 an alternative to pop-up windows in a web page. The code I have works (sort of). The problem is that I can move these layers around when I move the mouse slowly, however, if I move it fast the web browser looses track of the motion and leaves the...
4
2050
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, and then vise versa. The site also provided the code they claimed produced this (overlapping) effect. I plugged their code into the body of a vanilla html shown below, but the items were not overlapped, neither with
2
16419
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 to overlap correctly. You can see it on this page: www.creativekaysjewelry.com The images overlap exactly how I wanted and in the right position
2
1930
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 really huge problem, but I've been fighting it for days, and have received no help so far. Have a look at this (try it out in IE and Firefox please) http://www.discoverourmusic.com/rowan/css/home.html - The problem's with the fairy at the top. On...
3
3504
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 middle and very close to left border. How do I control bullet image positioning? Please advise a nice hack. Thanks
2
3742
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 most part, I have had no issues using the selectors, but I am having a very strange issue which does not seem to make much sense to me. Please advise if you have any input at all. Note, I am keeping this description at a high level for now because I...
0
9456
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
10040
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9846
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
9713
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
8713
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
5142
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...
1
3806
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
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.