Ensure that a image in a table (scrolled) is visible

Ensure that a image in a table (scrolled) is visible

am 08.01.2008 18:34:47 von Courtney

I have a table (produced from a datalist) that has an image followed by
text. The image is a 32px scalled down version of the actual image. When
the user moves over the image I want the image to expand to 72px. This
works fairly well but if I am on the last image and that image is in a list
which requires a scrollbar, the javascript code that expands the image makes
it show such that only a couple of pixels are visible and the mouse now does
not hover over the image. I would like to scroll in the table such that the
image will show once the image is expanded.

Any ideas??

TIA
Lloyd Sheen

Re: Ensure that a image in a table (scrolled) is visible

am 08.01.2008 20:02:18 von lexa

On Jan 8, 6:34=A0pm, "Lloyd Sheen" wrote:
> I have a table (produced from a datalist) that has an image followed by
> text. =A0The image is a 32px scalled down version of the actual image. =A0=
When
> the user moves over the image I want the image to expand to 72px. =A0This
> works fairly well but if I am on the last image and that image is in a lis=
t
> which requires a scrollbar, the javascript code that expands the image mak=
es
> it show such that only a couple of pixels are visible and the mouse now do=
es
> not hover over the image. =A0I would like to scroll in the table such that=
the
> image will show once the image is expanded.
>

1) Add to the last image

window.scrollBy(0,100);

it would scroll down +100px

2) Check current image position and a window size (e.g. using
document.body.clientHeight) and decide if you need to scroll the
window down or image is visible.

Hope it helps

Re: Ensure that a image in a table (scrolled) is visible

am 08.01.2008 20:17:00 von Courtney

"Alexey Smirnov" wrote in message
news:5ead33cd-7306-4ec8-9cf5-68c40bda8ac4@c4g2000hsg.googleg roups.com...
On Jan 8, 6:34 pm, "Lloyd Sheen" wrote:
> I have a table (produced from a datalist) that has an image followed by
> text. The image is a 32px scalled down version of the actual image. When
> the user moves over the image I want the image to expand to 72px. This
> works fairly well but if I am on the last image and that image is in a
> list
> which requires a scrollbar, the javascript code that expands the image
> makes
> it show such that only a couple of pixels are visible and the mouse now
> does
> not hover over the image. I would like to scroll in the table such that
> the
> image will show once the image is expanded.
>

1) Add to the last image

window.scrollBy(0,100);

it would scroll down +100px

2) Check current image position and a window size (e.g. using
document.body.clientHeight) and decide if you need to scroll the
window down or image is visible.

Hope it helps


The table is in an area of the page in which the scrolling is only to keep
the number of items to a dull roar. I allow only 10 items to be shown. If
there are more then a scrollbar will be shown (auto). It is not the page
that needs scrolling, just the table within the scroll area.

I am not real good with Javascript and have by using debugger; been looking
at the properties but can see nothing that will ensure that the image is
shown within the scroll area.

Lloyd

Re: Ensure that a image in a table (scrolled) is visible

am 08.01.2008 20:32:24 von lexa

On Jan 8, 8:17=A0pm, "Lloyd Sheen" wrote:
> "Alexey Smirnov" wrote in message
>
> news:5ead33cd-7306-4ec8-9cf5-68c40bda8ac4@c4g2000hsg.googleg roups.com...
> On Jan 8, 6:34 pm, "Lloyd Sheen" wrote:
>
> > I have a table (produced from a datalist) that has an image followed by
> > text. The image is a 32px scalled down version of the actual image. When=

> > the user moves over the image I want the image to expand to 72px. This
> > works fairly well but if I am on the last image and that image is in a
> > list
> > which requires a scrollbar, the javascript code that expands the image
> > makes
> > it show such that only a couple of pixels are visible and the mouse now
> > does
> > not hover over the image. I would like to scroll in the table such that
> > the
> > image will show once the image is expanded.
>
> 1) Add to the last image
>
> window.scrollBy(0,100);
>
> it would scroll down +100px
>
> 2) Check current image position and a window size (e.g. using
> document.body.clientHeight) and decide if you need to scroll the
> window down or image is visible.
>
> Hope it helps
>
> The table is in an area of the page in which the scrolling is only to keep=

> the number of items to a dull roar. =A0I allow only 10 items to be shown. =
=A0If
> there are more then a scrollbar will be shown (auto). =A0It is not the pag=
e
> that needs scrolling, just the table within the scroll area.
>

Ok, do you mean something like this?



...long table here....



If yes, then here the script which could scroll the div to the end: