473,654 Members | 3,040 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Positioning a popup relative to a table cell

Some of the cells in my ASP.NET 2 table have a popup that appears when the
user hovers the mouse over a text area that is indicated using an anchor
tag. The popup is implemented as a DIV tag (position: relative) and is
displayed and hidden using Javascript which calculates the popup position.

The table has vertical scrollbars and when the table is scrolled to the very
top then the popup is positioned correctly. However, if the table is
scrolled then the vertical positioning is incorrect and the popup isn't
visible at all.

Could someone help me out with the Javascript algorithm for setting the
popup position? I've looked at the DOM properties (offsetTop etc) but I
can't get a working algorithm that takes into account the scrollbar
position.
Jun 27 '08 #1
1 2049
On Jun 14, 1:49 pm, "chris f" <chrisfell...@n ospam.co.ukwrot e:
Some of the cells in my ASP.NET 2 table have a popup that appears when the
user hovers the mouse over a text area that is indicated using an anchor
tag. The popup is implemented as a DIV tag (position: relative) and is
displayed and hidden using Javascript which calculates the popup position.

The table has vertical scrollbars and when the table is scrolled to the very
top then the popup is positioned correctly. However, if the table is
scrolled then the vertical positioning is incorrect and the popup isn't
visible at all.

Could someone help me out with the Javascript algorithm for setting the
popup position? I've looked at the DOM properties (offsetTop etc) but I
can't get a working algorithm that takes into account the scrollbar
position.
Hi,,,,

this is the property you need to adjust

document.body.s crollTop

add this to your logic where you set "Y" postion

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
Jun 27 '08 #2

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

Similar topics

1
1847
by: Joe Conlin | last post by:
I am truncating data from an SQL database and have a script that populates a cell. The problem that I have is I have HTML tags in my database so if the data gets truncated in the middle of a tag, then my page goes...well, you know. What I am looking for is a way that I can contain ANY data (i.e. characters, tags, etc.) directly in that cell. So...If I have a <table> tag it will not throw off the rest of the table tags throughout my page. ...
3
12426
by: kAldam | last post by:
I am currently using IE 6.0 and 5.5 and the scenario is the following. I have a span that contains text, and the span is beign contained by a table cell (this is the way thing need to be in my application). I have an issue when the span has a heigth less than 18px (meaning height of the span, there is only one line of text and the height of the text is less than 18). The issue is that I start getting a padding, I add a color background to...
1
4195
by: Chris McGarry | last post by:
Hello, I'm new to style sheets and have been fighting with browser compatibility for two days. I'm developing a image selection page (similar to Ebay where the visitor can select and enlarge 1-6 thumbnail pictures) that will possibly be displaying different sized images within a table. The following code almost :) works correctly in I.E. (I'd like the images centered in the table vertically and horizontally) but does not work in...
0
2458
by: joeZ | last post by:
hi there! I'm just going crazy with this stuff I want to do I though was simple. I just want to locate an image (which is linkeable) below the bottom of a cell. I mean, if the cell is at 0,0, the image should be at 0,100%. I've tried it several ways, and I can make it work in both firefox & ie, but not at the same time!!.
2
3159
by: nonsensitor | last post by:
I'm just learning xhtml & css, primarily from westciv's online tutorials and css guide. I've run into a couple of problems with a page I'm developing that I can't figure out. The first problem is that I would like to display some text on top of an image within the header. I've tried using absolute positioning to specify where the phone number should appear in relation to the parent div (#header). However the text appears to be positioned in...
2
16407
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
3
8758
by: Eric Layman | last post by:
Hi everyone. An image allows alt attribute. When mouse over images with alt attribute, a small yellow popup would appear besides the mouse cursor. How to replicate this behaviour using a table cell instead? Is this even possible? Thanks.
1
16552
by: Bart Lateur | last post by:
I'm trying to put a utton at the bottom (right) of a TD cell, irrespective of what else is in there. Usually, with other HTML block elements, we're told to use position: relative on the parent element, and position: absolute; bottom: 0px;
8
2674
by: active | last post by:
I have a table on my page with rows and cells. I try to drag a table from the toolbox into one of the cells but the drag symbol shows it is not allowed (and the table does not drop) Can I inset a table into a cell? If so how. My problem does not really relate only to the table since I can't drag any
5
4433
by: prawasini | last post by:
hi, I have a code where a value in one of a table cell needs to be populated on a command button click event. Scenario: There is a main window having multiple <DIV>s In one of the Div there is a table havind ID on a concerned cell (initially blank). The div also has a command button. Now once the button is cliked, a popup window should open and the concerned cell (present in the main window) should be populated with a value. code to...
0
8375
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
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
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...
0
8707
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8482
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
7306
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
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
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.