473,473 Members | 4,257 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dhtml/floating element question..

http://www.francesdelrio.com/fixed_div.html

I picked up this neat script from www.dynamicdrive.com that does
something I had always wanted to do, namely put a div at a certain
distance from bottom of pg (for name-&-add-of-co footer..) and have it
stay there even if user scrolls up or down.. but: it gets screwed up
if user resizes window -- unless they reload after resizing.. I know
possibility of user resizing window is remote, but wanted to see anyway
if there was a way to make it work even if user resizes window.. also,
is there a way to make this script work in Netscape 6+?? thank you..

Frances Del Rio

Jul 23 '05 #1
7 1827
Frances Del Rio wrote:
http://www.francesdelrio.com/fixed_div.html

I picked up this neat script from www.dynamicdrive.com
Eeek. What part exactly do you consider "neat"?
that does something I had always wanted to do, namely put a div at a
certain distance from bottom of pg (for name-&-add-of-co footer..) and
have it stay there even if user scrolls up or down.. but: it gets
screwed up if user resizes window -- unless they reload after resizing..
Which should tell you that it is flawed, if not junk.
I know possibility of user resizing window is remote, but wanted to see
anyway if there was a way to make it work even if user resizes window..
Use CSS and position:fixed. As it does not work
with IE, you require a workaround for this browser:
<http://www.fabrice-pascal.de/artikel/posfixedie6/>
(I don't have a link to an English explanation,
[1] Google is your friend [psf 6.1].)
also, is there a way to make this script work in Netscape 6+??


Yes, do a complete rewrite to use standards compliant DOM methods.
document.all previded by IE and Opera only.

<http://www.w3.org/DOM/DOMTR>

And, of course, [1].
PointedEars
--
I have discovered a small, elegant proof that a^n + b^n = c^n has no integer
solutions for n greater than 2, but this box doesn't do TeX, and I will
except no lesser layout language.
Jul 23 '05 #2
Thomas 'PointedEars' Lahn wrote:
Frances Del Rio wrote:
http://www.francesdelrio.com/fixed_div.html

I picked up this neat script from www.dynamicdrive.com
Eeek. What part exactly do you consider "neat"?

touchée... the effect is neat, I meant.. I did feel the script was a
bit "verbose" but since I don't know how to do this just made do w/it..
that does something I had always wanted to do, namely put a div at a
certain distance from bottom of pg (for name-&-add-of-co footer..) and
have it stay there even if user scrolls up or down.. but: it gets
screwed up if user resizes window -- unless they reload after resizing..

Which should tell you that it is flawed, if not junk.


oops.. :) CSS position:fixed sounds like a great idea, but: how do I
make div appear AT A CERTAIN DISTANCE FROM THE BOTTOM OF WINDOW,
REGARDLESS OF HEIGHT OF CLIENTHEIGHT..

in his script the guy has:

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")?

document.documentElement : document.body
}

I have no idea what this does, but have a feeling this is the key here,
because further down he has:

var w=ietruebody().clientWidth-195
var h=50

which on a hunch I changed to

var w=100
var h=ietruebody().clientHeight-60

and this worked in the sense it fixed my div where I wanted it..
anyway, key here is I need this div (which is nothing but plain HTML
text..) to show up about 60 px off the bottom of the screen, regardless
of what clientHeight happens to be... and then when user scrolls for it
to stay fixed.. is this possible?? in IE AND N??
Use CSS and position:fixed.

this is not working.. here is code I have now:

#footer {position:fixed; top:200px; left:150px; z-index:1}

(I actually want it a lot further down, but used this value just to
test..) if position:fixed does not work w/z-index I'm in trouble, since
I HAVE to have z-index, since everything on page is sitting on a bg img
positioned w/z-index:0...

I searched google for "CSS position:fixed" and among other things I
found this page, http://devnull.tagsoup.com/fixed/
where I found the weirdest code: for that img on top right that stays
fixed when you scroll check out the code I found:

<div class="overhead">
<h1><a href="http://tagsoup.com/"><imgalt="Tagsoup homepage"
src="/_img/logo.png"></a> <code>position:fixed</code>fixed for
IE/win</h1></div>

what on earth is this?? <code>...</code>.. who has ever seen such a
thing? of course when I tried to implement it in my own situation it
wouldn't work.. code on this page is full of really weird stuff, like
for example,

<divclass="foobar"><code><ahref="/">devnull</a>['<a href="/#toc">
<abbrtitle="Table of contents">toc</abbr></a>']</code></div>

ok, thank you very much for yr help.. Frances


Jul 23 '05 #3
Hello PointedEars.. :) actually I just found a very simple solution:
http://www.francesdelrio.com/fixed_div.html

#footer {position:fixed; bottom:20px; left:150px; border:2px}

and that's it.. it works beautifully.. and it even works if user
resizes window... just that one little line of code.. it's almost too
good to be true.. and it is!! it doesn't work in IE!! it only works
in Netscape.. why is this??? and you know, I found this at the
"official" CSS specs, at
http://www.w3.org/TR/REC-CSS2/visure...ed-positioning..
(nothing in there about how this only works in Netscape..) I know this
has become a CSS question at this point, but since you responded to me
before w/a CSS solution thought I'd run this one by you, in case you can
shed some light.. (and I did post a query at the CSS ng...) ok.. thank
you again.. Frances

PS: are your ears really pointed??? :) :) :)
Thomas 'PointedEars' Lahn wrote:
Frances Del Rio wrote:

http://www.francesdelrio.com/fixed_div.html

I picked up this neat script from www.dynamicdrive.com

Eeek. What part exactly do you consider "neat"?

that does something I had always wanted to do, namely put a div at a
certain distance from bottom of pg (for name-&-add-of-co footer..) and
have it stay there even if user scrolls up or down.. but: it gets
screwed up if user resizes window -- unless they reload after resizing..

Which should tell you that it is flawed, if not junk.

I know possibility of user resizing window is remote, but wanted to see
anyway if there was a way to make it work even if user resizes window..

Use CSS and position:fixed. As it does not work
with IE, you require a workaround for this browser:
<http://www.fabrice-pascal.de/artikel/posfixedie6/>
(I don't have a link to an English explanation,
[1] Google is your friend [psf 6.1].)

also, is there a way to make this script work in Netscape 6+??

Yes, do a complete rewrite to use standards compliant DOM methods.
document.all previded by IE and Opera only.

<http://www.w3.org/DOM/DOMTR>

And, of course, [1].
PointedEars


Jul 23 '05 #4
On Sat, 21 Aug 2004 22:55:37 -0400, Frances Del Rio <fd***@yahoo.com>
wrote:

[snip]
<div class="overhead">
<h1><a href="http://tagsoup.com/"><imgalt="Tagsoup homepage"
src="/_img/logo.png"></a> <code>position:fixed</code>fixed for
IE/win</h1></div>

what on earth is this?? <code>...</code>..
It's simply another structural element. It marks the content as program
source code. This is usually rendered in a fixed-width font like Courier.
There are many other, similar mark-up elements. See section 9.2 of the
HTML Specification - Structured text.

<URL:http://www.w3.org/TR/html4/struct/text.html#h-9.2>
who has ever seen such a thing?
Me. Several times. :)
of course when I tried to implement it in my own situation it wouldn't
work.. code on this page is full of really weird stuff, like for
example,

<divclass="foobar"><code><ahref="/">devnull</a>['<a href="/#toc">
<abbrtitle="Table of contents">toc</abbr></a>']</code></div>


The only "wierd" thing about this is that you've removed some critical
whitespace that merges element and attribute names.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #5
On Sun, 22 Aug 2004 00:50:18 -0400, Frances Del Rio <fd***@yahoo.com>
wrote:

[Why doesn't position: fixed work?]

The simple reason, as I'm sure you'll be told in CIWAS, is that IE is poor
excuse for a browser. Microsoft simply haven't implemented it. Other
decent (and recent) browsers, however, have.

I'll leave it to the folks at CIWAS to provide alternate solutions.
PS: are [Lahn's] ears really pointed??? :) :) :)


I've wondered that, too. Or at least where the nickname comes from. Star
Trek/Fantasy literature fan?

[Snipped top-post]

Mike
Please don't top-post.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #6
Frances Del Rio wrote:
[...] actually I just found a very simple solution [...]

#footer {position:fixed; bottom:20px; left:150px; border:2px}
Yes, as I already wrote:
Use CSS and position:fixed. [...] and that's it.. it works beautifully.. [...]
it doesn't work in IE!! it only works in Netscape.. why is this???
Because IE is junk and only few recognize it.
That's why I recommended the workaround for IE:
[...] As*it*does*not*work with IE, you require
a workaround for this browser:
<http://www.fabrice-pascal.de/artikel/posfixedie6/>
(I don't have a link to an English explanation,
[1] Google is your friend [psf 6.1].)


(You may want to read replies more thorougly.)

However, I do not know if it is applicable to fixed bottom position as well.
[...] thank you again..
You're welcome.
PS: are your ears really pointed??? :) :) :)
Yes, indeed :)
[Top post]


<http://www.jibbering.com/faq/faq_notes/pots1.html>
PointedEars
--
"A good traveller has no fixed plans and is not intent on arriving."
-- Lao Tzu
Jul 23 '05 #7
Frances Del Rio wrote:
[...] actually I just found a very simple solution [...]

#footer {position:fixed; bottom:20px; left:150px; border:2px}
Yes, as I already wrote:
Use CSS and position:fixed. [...] and that's it.. it works beautifully.. [...]
it doesn't work in IE!! it only works in Netscape..
It works in all Mozilla/5.0 which includes Netscape _6+_.
why is this???
Because IE is junk and only few recognize it.
That's why I recommended the workaround for IE:
[...] As*it*does*not*work with IE, you require
a workaround for this browser:
<http://www.fabrice-pascal.de/artikel/posfixedie6/>
(I don't have a link to an English explanation,
[1] Google is your friend [psf 6.1].)


(You may want to read replies more thoroughly.)

However, I do not know if it is applicable to fixed bottom position as well.
[...] thank you again..
You're welcome.
PS: are your ears really pointed??? :) :) :)
Yes, indeed :)
[Top post]


<http://www.jibbering.com/faq/faq_notes/pots1.html>
PointedEars
--
"A good traveller has no fixed plans and is not intent on arriving."
-- Lao Tzu
Jul 23 '05 #8

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

Similar topics

6
by: mary zelinski | last post by:
I have a word bank for a javascript crossword puzzle I'm working on. What I want to do is when a user clicks on a word in the word bank, it crosses itself out. I have tried: <a...
2
by: mr_burns | last post by:
hi there, i would like a book that will explain concepts of javascript and dhtml instead of, for example, ten tutorials on how to do specific things in js or dhtml. ideally a book thats can...
6
by: Jon Davis | last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current browsers using: <object id="extendedhtml" type="text/html" data="otherpage.html" width="250" height="400"></object> ...
3
by: adrian suri | last post by:
Hi short question are selectors h1, h2 <script> p etc now case sensitive in the world of DHTML eg transitional / strict regards Adrian
32
by: ma740988 | last post by:
template <class T> inline bool isEqual( const T& a, const T& b, const T epsilon = std::numeric_limits<T>::epsilon() ) { const T diff = a - b; return ( diff <= epsilon ) && ( diff >= -epsilon );...
2
by: marko.suonpera | last post by:
I'm using the Newmat library where element access in ColumnVector type is defined as follows: typedef double Real; Real& ColumnVector::operator()(int m) { REPORT if (m<=0 || mnrows)...
6
by: Jeremy | last post by:
I've got a floating div which becomes visible when a link is clicked. I want the div to be hidden when the user clicks anywhere on the page except for whithin the div. What is the best way to do...
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,...
1
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
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.