Non scrolling block, like frames but without frames

B

Brian Cryer

Does anyone know whether its possible (perhaps using css) to have an area on
a page (say a menu bar at the top of the page) to be fixed so that it is
always visible regardless of how the page is scrolled - much as you would
get if you used frames but without using frames.

I'm thinking of a site redesign and one idea I've had would use a fixed
non-scrolling portion of the browser window, but I'm just not sure whether
its possible without resorting to frames.

TIA.
 
J

J.O. Aho

Brian said:
Does anyone know whether its possible (perhaps using css) to have an area on
a page (say a menu bar at the top of the page) to be fixed so that it is
always visible regardless of how the page is scrolled - much as you would
get if you used frames but without using frames.

Yes, use the position option absolute for the dive where you have the menu bar.
 
R

Richard Formby

Does anyone know whether its possible (perhaps using css) to have an area
on a page (say a menu bar at the top of the page) to be fixed so that it
is always visible regardless of how the page is scrolled - much as you
would get if you used frames but without using frames.

position: fixed

Doesn't work with IE.
I'm thinking of a site redesign and one idea I've had would use a fixed
non-scrolling portion of the browser window,

Why? You just use up valuable real estate where you could be displaying
content. Most of us are used to [whatever it is you want to put there]
scrolling with the page.
resorting to frames.

Don't.
 
B

Brian Cryer

J.O. Aho said:
Yes, use the position option absolute for the dive where you have the menu
bar.

Unless I'm doing something wrong, even with absolute positioning if the
browser scrolls then the item I've positioned stills scrolls with it. I'd
like something that stays put, regardless of browser scrolling - a bit like
you can do with the background-image on a page.
 
B

Brian Cryer

Richard Formby said:
position: fixed

Doesn't work with IE.

Now that you've shown me what I should be looking for, there is a work
around for IE - http://www.cssplay.co.uk/layouts/fixed.html.
I'm thinking of a site redesign and one idea I've had would use a fixed
non-scrolling portion of the browser window,

Why? You just use up valuable real estate where you could be displaying
content. Most of us are used to [whatever it is you want to put there]
scrolling with the page.

You are probably right. I was interested in whether it could be done, but I
accept the arguments against doing it - so I probably won't.

Thanks.
 
J

Jukka K. Korpela

Scripsit Richard Formby:
position: fixed

Doesn't work with IE.

Works now, in IE 7 in "standards" mode.

Older versions are still rather common, so I would use position: fixed only
when the page degrades gracefully when position: fixed is ignored. There's
no simple workaround really, since old versions of IE are foolish enough to
_recognize_ the value fixed but _implement_ it as if it were static, so you
can't just use { position: absolute; position: fixed; ... } - you would get
a "static" (i.e., non-positioned) element on old versions of IE.
 
E

Ed Seedhouse

Yes, use the position option absolute for the dive where you have the menu bar.

No, that won't do it. What he wants is position "fixed", but
unfortunately IE6 and below don't support that.
 
D

dorayme

Why? You just use up valuable real estate where you could be displaying
content. Most of us are used to [whatever it is you want to put there]
scrolling with the page.

You are probably right. I was interested in whether it could be done, but I
accept the arguments against doing it - so I probably won't.[/QUOTE]

Before accepting this too quickly in respect to fixed
positioning, perhaps consider that it is not a good _general_
argument. It certainly applies to some things. You gave just an
example in your op, there are other examples, like a left
navigation bar, a neat vertically economical top horizontal
navigation strip that _could_ be very handy to have visible at
all times.

The difficulties of cross popular browser implementation -
without using frames (which have other unrelated problems) - are
a good reason to consider it is not worth using fixed. So too is
something not mentioned so far. Some people report a jerkiness in
the scrolling as a side effect. This also is a good argument
against.
 
B

Brian Cryer

dorayme said:
Why? You just use up valuable real estate where you could be displaying
content. Most of us are used to [whatever it is you want to put there]
scrolling with the page.

You are probably right. I was interested in whether it could be done, but
I
accept the arguments against doing it - so I probably won't.

Before accepting this too quickly in respect to fixed
positioning, perhaps consider that it is not a good _general_
argument. It certainly applies to some things. You gave just an
example in your op, there are other examples, like a left
navigation bar, a neat vertically economical top horizontal
navigation strip that _could_ be very handy to have visible at
all times.[/QUOTE]

Yes, agreed. Good point. I was thinking about this last night and a left
navigation bar struck me as something *potentially* useful to have a fixed
location. I hadn't thought about a small horizontal navigation strip. Good
suggestion. When I have time I'll play with some ideas and see what works
and what doesn't.
The difficulties of cross popular browser implementation -
without using frames (which have other unrelated problems) - are
a good reason to consider it is not worth using fixed. So too is
something not mentioned so far. Some people report a jerkiness in
the scrolling as a side effect. This also is a good argument
against.

I'd always assumed that the "jerkiness" was because the implementation
relied on JavaScript - at least on the sites I've seen (but then I never
actually looked to see how it was implemented).. If I ever do decide to go
down this route I'll try a prototype out on a number of browsers. Certainly
if its "jerky" then that's a good reason for not doing it.

Thanks.
 
D

dorayme

"Brian Cryer said:
I'd always assumed that the "jerkiness" was because the implementation
relied on JavaScript - at least on the sites I've seen (but then I never
actually looked to see how it was implemented).. If I ever do decide to go
down this route I'll try a prototype out on a number of browsers. Certainly
if its "jerky" then that's a good reason for not doing it.

Well no... no lesser a being than Spartanicus [God] has reported
this as a result of css implementation. Imagine how it shakes and
shudders for lesser mortals...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top