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

Display error with "fix positioned" div

Hello,

I have a web page that contains the following things.
1) Lots of text, so that the page is longer/higher than one browser screen.
2) Within that text there is an input text field.
3) On some place after there, there is a select tag.
4) I have the following div tag absolutely positioned on the page, somewhere
between all the text.
<div id="fixeddiv"
style="position:absolute;left:0px;top:50px;width:3 00px;height:100px;border:s
olid 1px #000000;background:#ffffaa">This is the fixed div tag text.</div>

Now what I first want is that the div tag doesn't move on the view of the
user when I use the vertical browser scrollbar to see all the text. To do
so, I have used the setTimeout function where I always change the value of
the "top" style attribut of the div tag according to the amount of pixels I
have scrolled. The code line is:
fixeddiv.style.top=document.body.scrollTop+50;
The second I want is that the div has to be NOT transparent, so I do not
want to see the normal page text within my div box. In the div box only the
div text inside (This is the fixed div tag text.) should be displayed.

For the moment all goes right with my idea, but now there comes the problem.
1) When scrolling the normal page text (see 1) ), it disappears behind the
div. -> OK
2) When scrolling the input text field, it also disappears behind the
div. -> OK
3) But when scrolling the select tag, it does NOT disappear behind the
div. -> NOT OK
Instead I can see the select tag fully in front of my div, as if the
select had a higher display priority than the div.
But this behaviour is annoying. If you can't believe, please try it!

Does anybody know how to fix this behaviour? I don't want to use a frame to
have a fixed positioned text.

If you need the full code of my page, please let me know.

Any help to this would be very appreciated. Thanks in advance.

Nice greetings from
Thomas
Jul 21 '05 #1
5 5857
On Thu, 14 Oct 2004 18:25:41 +0200, Thomas Hoheneder
<th**************@gmx.de> wrote:
If you need the full code of my page, please let me know.


Please post a URL to a test case, even if it isn't the actual page that
you'll probably say you can't reveal. Don't post a mess of code, please.
Jul 21 '05 #2
> Please post a URL to a test case, even if it isn't the actual page that
you'll probably say you can't reveal. Don't post a mess of code, please.


Please see http://www.thomas-hoheneder.de/scrolldiv.html

Nice greetings from
Thomas
Jul 21 '05 #3
Thomas Hoheneder wrote:
Please post a URL to a test case, even if it isn't the actual page that
you'll probably say you can't reveal. Don't post a mess of code, please.

Please see http://www.thomas-hoheneder.de/scrolldiv.html


Doesn't work in Firefox:

Error: syntax error
Source File: http://www.thomas-hoheneder.de/scrolldiv.html
Line: 6
Source Code:
<pe="text/javascript">

Error: scrollDiv is not defined

If I fix that error, Firefox behaves as you want.

I do see your problem in IE, however. Fiddling with z-index appears not
to work - this might be an IE bug (shock!).

The answer is to use a better browser...

--
Mark.
http://tranchant.plus.com/
Jul 21 '05 #4
Thomas Hoheneder wrote:
Instead I can see the select tag fully in front of my div, as if the
select had a higher display priority than the div.
But this behaviour is annoying. If you can't believe, please try it!


Yes, it is annoying, and yes, it is an IE bug - or perhaps "feature".
See http://support.microsoft.com/default...;EN-US;q177378

"Windowed" elements such as selects will always render above normal HTML
elements. There's a horrible, nasty, ugly, hacky workaround at
http://dotnetjunkies.com/WebLog/jkin...07/21/488.aspx which
involves placing an empty iframe over the select. I wouldn't recommend
this though!

As an aside, the behaviour you want is already present in modern
browsers without using javascript using position: fixed. There's even an
easier way to emulate the behaviour in IE - see
http://devnull.tagsoup.com/fixed/

HTH

P
Jul 21 '05 #5

"Phil Evans wrote:
Yes, it is annoying, and yes, it is an IE bug - or perhaps "feature".
See http://support.microsoft.com/default...;EN-US;q177378 <snip> elements. There's a horrible, nasty, ugly, hacky workaround at
http://dotnetjunkies.com/WebLog/jkin...07/21/488.aspx which <snip> http://devnull.tagsoup.com/fixed/


It really seems to be a bug (or a feature) of IE. Thank you for your URL's
and advices.
I think I will do it with an iframe within a div, which is of course no very
good solution, but I got it work.
The second disadvantage is, that I have to put the iframe's content into a
separate HTML file...

Nice greetings from
Thomas
Jul 21 '05 #6

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

Similar topics

4
by: qazmlp | last post by:
// Test.C Line-300: namespace Line-301: { Line-302: std::vector<std::string> vecaNS ; Line-303: } The 'SUN Forte 7 C++ Compiler' reports the following warning for the above code:...
0
by: Sathya shankar | last post by:
Hi All, I have read this article - http://support.microsoft.com/default.aspx?scid=kb;EN-US;826437 I have installed .NET framework 1.1 SP1 and I have also set the VerificationCompatibility to...
11
by: TheBurgerMan | last post by:
Hi all. I am using W2K3, .NET2 on a machine running AD and Exchange. I started getting the message below last week. I googled the error and not much was returned, but I did find this;...
3
by: Vidit | last post by:
Hi I keep getting the error "Error Creating Windows Handle" in my application and different places in the code. This occurs only to certain users. Its very random and cannot be reproduced in...
1
by: Java Guy | last post by:
I'm trying to view a web page. IE tells me there are (Java?) errors on the page. Here they are: Line: 15 Char: 7 Error: Wrong number of arguments or invalid propert assignment Code: 0 URL:...
1
by: Josta7 | last post by:
Hi. I've been using Access for a couple of years now, but everything I know about it is self-taught. This makes me a little self-conscious/worried - I feel like I know how to do a lot, but I could...
1
by: Mikewill | last post by:
I need to fix my Moodle database and someone has told me that they "used their server's CPanel and the mySQL feature to "check" then "fix" his moodle database". I dont have a cpanel and was hoping...
3
by: shammika | last post by:
Hi, can you give more details about the Pre fix & Post fix of java with examples.
4
by: mariaz | last post by:
Hello, I am getting a Notice error on my website that says: Notice: Undefined index: _created_formatted in C:\EasyPHP1-8\www\eP\components\com_jambook\jxtemplate.php(125) : regexp code on line 1 ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: 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
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...

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.