473,399 Members | 3,832 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.

positioning depending upon scroll

hsriat
1,654 Expert 1GB
I have a toolbox that appears dynamically on the screen.

Now what I want is, that this toolbox should have a top:120px and position:absolute.
But when page is scrolled up by more then 120px, its style should change to top:0px and position:fixed.

Here is an example of what I want. You can see show site navigation on top left of the page which have similar properties which I want.

It there any CSS way to do this?
May 13 '08 #1
3 1187
harshmaul
490 Expert 256MB
hi hsriat,

Our paths aint crossed in a long time!! anyway... CSS HTML aint designed to do stuff like that. you need to use javascript to control where that sort of content goes.

You can only position images like that using background properties and such.
May 13 '08 #2
hsriat
1,654 Expert 1GB
hi hsriat,

Our paths aint crossed in a long time!!
Hey Harjit,
I agree, but I've been regular here, not in this forum, but JavaScript and PHP.
Glad to know you remember :)

anyway... CSS HTML aint designed to do stuff like that. you need to use javascript to control where that sort of content goes.
Even I doubted, but just hoped may be there's some CSS positioning trick.
Like I kept on doing onmouseover="this.className='class2'" till one day I came to know there's something called :hover in CSS. :D

Anyhow, I'll try that out in JavaScript.

Regards,
Harpreet
May 13 '08 #3
harshmaul
490 Expert 256MB
good luck mate!!!!!!
May 14 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: murali | last post by:
Hello everyone, I used absolute positioning with div tag in my website. The page looks cool as long as someone doesn't try to zoom in by increasing the text size (ctrl++ or thru changing font...
6
by: Anna | last post by:
Hi all. I have a div with a scrollbar, which contains an image: <div style=" width:15em; height:10em; overflow:scroll;"> <img src="some.gif"/> </div> The image is rather small, it occupies...
1
by: Frances Del Rio | last post by:
don't know if I'll succeed, have spent a lot of time already trying to figure this out: I would like to position a footer (co. name, address, etc..) at the bottom of browser page, in such a way...
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
17
by: George Hester | last post by:
http://tinyurl.com/5uj6w The lower middle icon the "block" should not drop down when the mouse is over it. How can I stop that? Also the navigation divs both top and bottom should follow the...
20
by: Geoffrey H. Goldberg | last post by:
I have made a remote control window which opens from its parent. On loading, the remote is positioned relative to the screen using window.moveTo(x,y). What I would like to happen is the remote...
1
by: Lars A. Gundersen | last post by:
So I'm starting out with CSS positioning, and it seems to work fine - until I check in IE6/Win, of course. I'm trying to use absolute positioning to place a box with my site's main contens area...
4
by: libsfan01 | last post by:
hi is it possible to position a div relative to the document window? so for example if the page is scrolled down the div in question does not move regards marc
4
bats fur eels
by: bats fur eels | last post by:
Hi, I was hoping if anyone knew if it were possible using HTML or other basic scripts that enable you to lets say, scroll the webpage down a few margins upon load of page or script. So that it will...
1
by: db007 | last post by:
Hi, I have a problem with a current project and the scroll position. I have an AJAX enabled website using Visual Studio 2005 and ASP.Net 2.0. The project also uses masterpages. On the...
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: 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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
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,...

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.