473,399 Members | 2,278 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,399 software developers and data experts.

Javascript popup above the page fold!

Hi,

Is there a way to open a javascript popup such that it is positioned
above the page fold and always visible.

I have a page which has links, each link on mouseover shows a DHTML
popup. but on the link near the bottom of the page the DHTML popup
shows up only half way and user has to scroll down to see the full
popup. I want to ensure that the popup opens up in a way that it is
always completely visible.

Any help will be greatly appreciated.

Regards,
SB

Jun 5 '06 #1
1 2025

function positionElOnscreen(someId, elTop, elHeight) {
var topz= elTop;
var heightz= elHeight;
topz = (document.body.clientHeight - (heightz + 20));
document.getElementById(someId).style.top = topz;
}

function aboveTheFold (someId, elTop, elHeight) {
if (document.body.clientHeight < (elTop + elHeight)) {
positionElOnscreen(someId, elTop, elHeight);
}
}
NOTE: The "extra" variables (topz, heightz) are a necessary
workaround, see http://www.quirksmode.org/js/cross_dhtml.html

This code works in IE6 and FF 1.5, and AFAIK Safari. However, this
feature is currently in use by at least one of my clients, and I
haven't heard any complaints about it. So it may work pretty well in
other browsers as well.

There's a working example here:

http://www.onemorebug.com/meme.washe...avascript.html

SlimBiker wrote:
Hi,

Is there a way to open a javascript popup such that it is positioned
above the page fold and always visible.

I have a page which has links, each link on mouseover shows a DHTML
popup. but on the link near the bottom of the page the DHTML popup
shows up only half way and user has to scroll down to see the full
popup. I want to ensure that the popup opens up in a way that it is
always completely visible.

Any help will be greatly appreciated.

Regards,
SB


Jun 5 '06 #2

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

Similar topics

11
by: Dana Smith | last post by:
Can anybody explain why when I have a hyperlink on a page with the code similar to below, after the user clicks on the link, the desired window opens but the page with the hyperlink changes to a...
2
by: TeknoCat | last post by:
Hey everyone, I may be repeating myself here, but if someone sent a reply then I missed it, and I can't get Outlook Express to download any messages more than 2 days old. Anyway, I'm having a...
2
by: Jeannie | last post by:
I have a popup window which is a slideshow of about 7 images. When the popup window loads, the first image is present and then the viewer can select next or previous to scroll through the rest of...
4
by: ...D. | last post by:
OK. I am halfway decent with HTML. Now I want to try javascript for some things that HTML cannot do. I have looked over a tutorial & all. What I want to do is create a button, that when...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
2
by: pantagruel | last post by:
I have an old web application I did where browsers with dynamic capabilities received a drop down menu on the top of the page and a fold out on the left hand side of the page and non-dynamic...
12
by: Mark Fox | last post by:
Hello, I am attempting to do something very simple. I have a page MainPage.aspx and a popup window Popup.aspx. When users click on the linkbutton in the popup window I am looking to do some...
3
by: Christina | last post by:
Hello !! I want a link on my vb.net web application, which when clicked, popUp's up and shows a msg. AFAIK, Javascript is the best way to go. So I created an asp:hyperlink, and on its 'on...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
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?
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
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...
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.