473,387 Members | 1,891 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.

position of link on IE6 browser

Hello
I'm trying to assign the position of a popup the same as a link.
The position of link is coming out ok. But the popup is not
being shown at the left,top coordinates of the link. I'm using IE6 and
getting workedup like silly. I'd appreciate your help.
Thank you

document.getElementById('popup').style.visibility= "visible";
var top= document.body.scrollTop +
document.getElementById('link1').offsetTop;
document.getElementById('popup').style.top=top;
var left =document.body.scrollLeft +
document.getElementById('link1').offsetLeft;
document.getElementById('popup').style.left=left;

Aug 3 '05 #1
7 1422
How can I display the popup relative to the top of the frame. Using the
offsetTop and offsetLeft the popups appear at the bottom of the frame.
Thanks for your help

Aug 3 '05 #2
Still waiting for help!!!!

Aug 4 '05 #3
Try this and let me know what pops up (if anything)
document.getElementById('popup*').style.visibility ="visible";
var top= document.body.scrollTop +
document.getElementById('link1*').offsetTop;
document.getElementById('popup*').style.top=top;
var left =document.body.scrollLeft +
document.getElementById('link1*').offsetLeft;
document.getElementById('popup*').style.left=left;

alert(document.getElementById('link1*').offsetTop)
alert(document.getElementById('link1*').offsetLeft )

if you get nothing, then there's your problem.If the values were not
set by js, this is likely.
if you get something like '200px' then you are adding strings to
numbers and
will get the wonderful value 'NaN' which is no good.

let me know.

TheGeek

Aug 4 '05 #4
Hi Peter

All the popup's are placed on the top-left corner instead
of on the links. The alerts showed numbers --- no px.

Thanks for your help.

Aug 4 '05 #5
VK
May want to check this post:

<http://groups-beta.google.com/group/comp.lang.javascript/browse_frm/thread/53548d50037263db/24424e0fc46922c9?lnk=st&q=requested+group:comp.lan g.javascript+author:VK&rnum=2&hl=en#24424e0fc46922 c9>
so***********@yahoo.com wrote:
Hi Peter

All the popup's are placed on the top-left corner instead
of on the links. The alerts showed numbers --- no px.

Thanks for your help.


Aug 4 '05 #6
Why can't I position a popup over a link when the tooltip gets
positioned exactly where I want to position the popup?

Thanks for your help.

Aug 4 '05 #7
I fixed my problem. The solution is at
http://www.quirksmode.org/js/findpos.html. Thanks for all your help!

function findPosX(obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
return curleft;
}

function findPosY(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}

Aug 4 '05 #8

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

Similar topics

4
by: Matt | last post by:
When the user resize the browser, the "Frequently Used Link" and "Table 1" and "Table 2" will shift to the left hand side, but table position is unchanged. I really have no idea how to fix that. I...
2
by: glutinous | last post by:
I'm assuming that this is not possible (I haven't found a way), but if there's one thing I know for sure, one shouldn't assume anything about what people know how to do on this NG... Enough...
1
by: lakecjl | last post by:
I have a table that is 780px wide centered in the browser. I don't know how wide the browser will be, but I have a various div elements that must stay in the same place relative to the underlying...
1
by: leegold | last post by:
I have a "see details" link over in the bottom right of a table cell - exactly were I want it. But when I resize the browser window to make it smaller and squish it together the link does not stay...
16
by: Konrad Viltersten | last post by:
Suppose you got a really long page and you'd like to enable the user (supposedly, there's only one but if it's not to difficult we could extend that to any number) not to have to scroll to the...
4
by: Ross | last post by:
I have been using the following script to return a scrollbar to the position it was in before the data was posted. It works in ie but not in firefox. Thanks, R. <script...
2
by: rockdale.green | last post by:
Hi, I do not know where should I start to solve this problem. I have a calendar inside a div on my webpage which will show /hide when user click a button. but the button is almost at the...
2
by: petermichaux | last post by:
Hi, It seems like determining element position in a web page is a difficult task. In the position reporting source code I've looked at there are special fixes for at least some versions of...
2
by: agbee1 | last post by:
Hello: I've finally made the effort to ween myself from overly using tables and use CSS for my positioning. However, I am having a problem with my navigational menu properly aligning in Firefox,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.