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

document.body.scrollTop for an "autoscroll: auto" css element

P: n/a
Hi, I'm putting together a little database of individuals categorized
by family. I have two lists, one that contains family names and one
that contains individuals' names. When you click on a link in the first
list, it generates from a mysql database all the people associated with
that family. When you click on an individual's name, it displays
biographical information.

The catch is, for space, I've put these lists in little boxes defined
by width, height, and the "autoscroll: auto" feature in css. When I
click a family name, it refreshes the page to load all the individuals,
and I lose how far down in the family box I scrolled. In other words,
if I choose "Whitman," the page refreshes and I see all the Whitman
family members in the right (individuals) box, but the left (family)
box scrolls back up to the top to display Alexander, Bartlett, Bishop,
etc.

I was reading about document.body.scrollTop, but my experiments haven't
allowed me to apply this to a scrolling element within the page such as
my families box. Does anyone have any suggestions? I tried things like
document.bio1.scrollTop (where bio1 is the id of my families box), but
that didn't do anything. It's not the biggest problem in the world, but
it would be really cool if I could get it working somehow.

Thanks,
Alexandra

Jul 29 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sorry, I misspoke. My block elements use the "overflow: auto" tag, not
"autoscroll: auto"
Je********@gmail.com wrote:
Hi, I'm putting together a little database of individuals categorized
by family. I have two lists, one that contains family names and one
that contains individuals' names. When you click on a link in the first
list, it generates from a mysql database all the people associated with
that family. When you click on an individual's name, it displays
biographical information.

The catch is, for space, I've put these lists in little boxes defined
by width, height, and the "autoscroll: auto" feature in css. When I
click a family name, it refreshes the page to load all the individuals,
and I lose how far down in the family box I scrolled. In other words,
if I choose "Whitman," the page refreshes and I see all the Whitman
family members in the right (individuals) box, but the left (family)
box scrolls back up to the top to display Alexander, Bartlett, Bishop,
etc.

I was reading about document.body.scrollTop, but my experiments haven't
allowed me to apply this to a scrolling element within the page such as
my families box. Does anyone have any suggestions? I tried things like
document.bio1.scrollTop (where bio1 is the id of my families box), but
that didn't do anything. It's not the biggest problem in the world, but
it would be really cool if I could get it working somehow.

Thanks,
Alexandra
Jul 29 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.