By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,141 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

Locking a DIV so that it ignores scroll ?

P: n/a
I need to lock a DIV in place so that regardless of the scroll position,
it remains stuck in a corner. Currently I'm hooked into the scroll
events and I'm positioning dynamically based on the scroll amount. So if
you scroll down 1000 pixels, then I'm adding 1000 pixels to the position
I normally would calculate to fit it in the corner. This works cross
browser already, but the responsiveness to the scroll events isn't
immediate enough. You can see a bit of a stuttering effect.

Does anyone know of a property that will lock a DIV to a certain
position in the browser rather than a certain position in the page (yes
I know it's CSS but there isn't a CSS forum on my news server and this
is where the clever people are)? I'm pretty sure I heard that such a
property exists but it's not something that's easy to google. The terms
involved find way too many results that aren't relevant. I haven't even
managed to find (via google) somebody that's doing what I'm already doing.

I don't mind if it's using some IE and/or Gecko proprietary properties.
Nov 13 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Nov 13, 8:22 pm, Stevo <ple...@spam-me.comwrote:
I need to lock a DIV in place so that regardless of the scroll position,
it remains stuck in a corner. Currently I'm hooked into the scroll
events and I'm positioning dynamically based on the scroll amount. So if
you scroll down 1000 pixels, then I'm adding 1000 pixels to the position
I normally would calculate to fit it in the corner. This works cross
browser already, but the responsiveness to the scroll events isn't
immediate enough. You can see a bit of a stuttering effect.

Does anyone know of a property that will lock a DIV to a certain
position in the browser rather than a certain position in the page (yes
I know it's CSS but there isn't a CSS forum on my news server and this
is where the clever people are)? I'm pretty sure I heard that such a
property exists but it's not something that's easy to google. The terms
involved find way too many results that aren't relevant. I haven't even
managed to find (via google) somebody that's doing what I'm already doing.

I don't mind if it's using some IE and/or Gecko proprietary properties.
style="position: fixed"

Nov 13 '07 #2

P: n/a
Darko wrote:
On Nov 13, 8:22 pm, Stevo <ple...@spam-me.comwrote:
>I need to lock a DIV in place so that regardless of the scroll position,
style="position: fixed"
Oh man, you've gotta be joking. Thanks D.

<bangs head against the wall for not seeing the obvious>
Nov 13 '07 #3

P: n/a
On Nov 13, 9:32 pm, Stevo <ple...@spam-me.comwrote:
Darko wrote:
On Nov 13, 8:22 pm, Stevo <ple...@spam-me.comwrote:
I need to lock a DIV in place so that regardless of the scroll position,
style="position: fixed"

Oh man, you've gotta be joking. Thanks D.

<bangs head against the wall for not seeing the obvious>
:)
Nov 15 '07 #4

P: n/a
Darko wrote:
On Nov 13, 8:22 pm, Stevo <ple...@spam-me.comwrote:
>Does anyone know of a property that will lock a DIV to a certain
position in the browser rather than a certain position in the page (yes
I know it's CSS but there isn't a CSS forum on my news server and this
is where the clever people are)? I'm pretty sure I heard that such a
property exists but it's not something that's easy to google. The terms
involved find way too many results that aren't relevant. I haven't even
managed to find (via google) somebody that's doing what I'm already doing.

I don't mind if it's using some IE and/or Gecko proprietary properties.

style="position: fixed"
That doesn't work in IE before version 7, of course. However, there are
several workarounds of which I prefer

[de] http://artikel.fabrice-pascal.de/posfixedie6/ pp.

(Sorry, it would appear this has not been translated yet, so might need
to try your luck with Google Translate or Babelfish and apps like that.)
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Nov 15 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.