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

Can I prevent an item from scrolling with the page?

Hello all,

Can I prevent something, say a <div>, from scrolling when the page is
scrolled? I know that with CSS, "background-attach: fixed" will anchor
the background element and prevent it from scrolling.

Is there a similar html/css variable or command that I can apply to a
DIV, TABLE, or IMG?

Viken K.

Dec 7 '05 #1
4 14915
Viken Karaguesian wrote:
Can I prevent something, say a <div>, from scrolling when the page is
scrolled? I know that with CSS, "background-attach: fixed" will anchor
the background element and prevent it from scrolling.

Is there a similar html/css variable or command that I can apply to a
DIV, TABLE, or IMG?


position: fixed

Supported by CSS 2 browsers.

JavaScript workarounds exist for MSIE.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Dec 7 '05 #2
Thanks for the reply.

Let me guess: IE6 is *not* a CSS 2 Browser, right? Can you point me in
the direction of where I can find some of these javascript workarounds?
Thanks.

Dec 8 '05 #3
Viken Karaguesian wrote:
Let me guess: IE6 is *not* a CSS 2 Browser, right? Can you point me in
the direction of where I can find some of these javascript workarounds?


As I don't remember any off the top of my head - google.com

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Dec 8 '05 #4

David Dorward wrote:
Viken Karaguesian wrote:
Let me guess: IE6 is *not* a CSS 2 Browser, right? Can you point me in
the direction of where I can find some of these javascript workarounds?


As I don't remember any off the top of my head - google.com


Try Quirksmode: http://www.quirksmode.org

Dec 8 '05 #5

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

Similar topics

7
by: JimO | last post by:
I teach HS computers and one of my kids has a web site with a textbox of info that the user can scroll down and read. The problem is that users can also enter text into it. Is there a way, or a...
14
by: Dave | last post by:
My web site is not particularly theme-based, but it contains an Art Gallery I'd like to display in a different perspective. I would like to horizontally scroll it, rather than vertically - as if...
1
by: Aravind | last post by:
Hi folks. I have a form that has a form header and form footer, which has a few command buttons. When I open the form, I have to scroll the form from left to right to view my data. The thing is,...
0
by: Steve | last post by:
The treeview has this habit of scrolling when you change the tree's selection so that the selected item is visible. 9 times out of 10 this is the behavior that you'd want, but what do I do to...
1
by: Tom Wild | last post by:
Hi I have a listbox on a webform which has Autopostback set to true. When the user selects an item in the listbox and the form reloads, the listbox scrolls to put the selected item as high up...
5
by: Jim Bayers | last post by:
I have a simple page, all that's on it is a datagrid. The datagrid is populated on page_load when it is bound to a datareader. The problem is: when a user refreshes the page, new records are...
2
by: P2P | last post by:
Hi I am wondering if someone know of a free cross-browsers vertical scrolling script that - is cross cross-browsers - will call the scrolling content from an external html page or from a...
0
by: toddw607 | last post by:
I have a datagrid in ASP.NET using VB.NET code which, when loaded it takes a parameter from the URL called DexNumb. When this parameter is brought it, it highlights the entire row Red and makes it...
6
by: Gustaf | last post by:
I'm working on a code generator for documentation of VBA projects. It outputs HTML docs, including simple JS. I don't have much experience with JS however, so I need some help with this sample...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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
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...

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.