Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #16582 > unrolled thread

Scroll a <table> Up/Down a bit ?

Started by"Mel Smith" <med_cutout_syntel@aol.com>
First post2012-10-12 11:26 -0600
Last post2012-10-14 08:45 -0600
Articles 9 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  Scroll a <table> Up/Down a bit ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-10-12 11:26 -0600
    Re: Scroll a <table> Up/Down a bit ? Danny <dann90038@gmail.com> - 2012-10-12 11:07 -0700
      Re: Scroll a <table> Up/Down a bit ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-10-12 13:07 -0600
        Re: Scroll a <table> Up/Down a bit ? Danny <dann90038@gmail.com> - 2012-10-12 13:04 -0700
          Re: Scroll a <table> Up/Down a bit ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-10-12 15:12 -0600
            Re: Scroll a <table> Up/Down a bit ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-10-13 10:10 -0600
      Re: Scroll a <table> Up/Down a bit ? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-12 21:08 +0200
    Re: Scroll a <table> Up/Down a bit ? Dr J R Stockton <reply1241@merlyn.demon.co.uk.invalid> - 2012-10-13 19:42 +0100
      Re: Scroll a <table> Up/Down a bit ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-10-14 08:45 -0600

#16582 — Scroll a <table> Up/Down a bit ?

From"Mel Smith" <med_cutout_syntel@aol.com>
Date2012-10-12 11:26 -0600
SubjectScroll a <table> Up/Down a bit ?
Message-ID<adr268Fp05cU1@mid.individual.net>
Hi:

    I have a big 3-column table with <td> cells that are outlined and 
contains approx 10 <br /> rows in each of the <td> cells.

    There are two objects (e.g., id="abc123") in each of these <td> cells.

In JS, I use :

        abc123el.scrollIntoView(); // to bring up a specific cell into 
view -- which is pretty big vertically.

However, this scrollIntoView() operation scrolls the table/cell up a bit too 
far, and I wish to scroll *down* a number of pixels --- say 5 or 10 px.

Question:

    So, after my scrollIntoView() operation, how do I 'scroll up/down a bit' 
programmatically ?

Thank you.

-Mel Smith

[toc] | [next] | [standalone]


#16586

FromDanny <dann90038@gmail.com>
Date2012-10-12 11:07 -0700
Message-ID<0e3f9c4e-50b4-4302-8143-dff4a1f090a2@googlegroups.com>
In reply to#16582
window.scrollBy(X,Y), to get say 10px down, window.scrollBy(0,10);

[toc] | [prev] | [next] | [standalone]


#16587

From"Mel Smith" <med_cutout_syntel@aol.com>
Date2012-10-12 13:07 -0600
Message-ID<adr84aFqcfhU1@mid.individual.net>
In reply to#16586
Danny said:

> window.scrollBy(X,Y), to get say 10px down, window.scrollBy(0,10);

Danny:

    I don't wish to scroll the _whole_ window--- just the <table> and its 
rows which are embedded in a separate <div>

    I'd 'like to say' :   mytableobj.scroll-up-a-bit ; or 
mytableobj.scroll-down-a-bit;

    or something like that.

Thanks for the response !

-Mel Smith 

[toc] | [prev] | [next] | [standalone]


#16590

FromDanny <dann90038@gmail.com>
Date2012-10-12 13:04 -0700
Message-ID<0684d4f7-e3cb-48fc-a72e-8deffe2766a6@googlegroups.com>
In reply to#16587
ok Mel, then
PARENTOFELEMENT.scrollTop+=10;  // to scroll that many pixels
check example at -> http://www.webdevout.net/test?04k&raw

[toc] | [prev] | [next] | [standalone]


#16592

From"Mel Smith" <med_cutout_syntel@aol.com>
Date2012-10-12 15:12 -0600
Message-ID<adrfemFs3h4U1@mid.individual.net>
In reply to#16590
Danny said:

> ok Mel, then
> PARENTOFELEMENT.scrollTop+=10;  // to scroll that many pixels
> check example at -> http://www.webdevout.net/test?04k&raw

Hi Danny:

    Thak you, I'll try that over the weekend.

-Mel

[toc] | [prev] | [next] | [standalone]


#16601

From"Mel Smith" <med_cutout_syntel@aol.com>
Date2012-10-13 10:10 -0600
Message-ID<adti32FbrrfU1@mid.individual.net>
In reply to#16592
Danny said:

>> PARENTOFELEMENT.scrollTop+=10;  // to scroll that many pixels
>> check example at -> http://www.webdevout.net/test?04k&raw
>
> Hi Danny:
>
>    Thak you, I'll try that over the weekend.
>
> -Mel
>


Hi Danny:

    It worked great !!

    I've put my  actual code below.

Thank you !


-Mel Smith

******* code to bring listing into wiew, then vertically position it better 
***
function liteup(nmlsid) {
var mlsid= nmlsid.toString() ;
var gmlsid = "G"+mlsid ;
var gmlsobj = document.getElementById(gmlsid) ;
gmlsobj.scrollIntoView() ;    // rough positioning
// lite up the address first
gmlsobj.style.background="blue" ;
gmlsobj.style.color="white" ;
// now liteup the mls number
var mlsobj = document.getElementById(mlsid) ;
mlsobj.style.background="blue" ;
mlsobj.style.color="white" ;
// now move the table/row/cell down a bit          //This next is from Danny
document.getElementById("listings").scrollTop -= 36;   // Thanks Danny !
return true ;
}
***************************************




[toc] | [prev] | [next] | [standalone]


#16588

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-10-12 21:08 +0200
Message-ID<XnsA0EAD708BB009eejj99@194.109.133.133>
In reply to#16586
Danny wrote on 12 okt 2012 in comp.lang.javascript:

> window.scrollBy(X,Y), to get say 10px down, window.scrollBy(0,10);

Usenet is not email.

Please quote what you are responding on.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#16621

FromDr J R Stockton <reply1241@merlyn.demon.co.uk.invalid>
Date2012-10-13 19:42 +0100
Message-ID<blAORbMcYbeQFw7I@invalid.uk.co.demon.merlyn.invalid>
In reply to#16582
In comp.lang.javascript message <adr268Fp05cU1@mid.individual.net>, Fri,
12 Oct 2012 11:26:31, Mel Smith <med_cutout_syntel@aol.com> posted:

>    So, after my scrollIntoView() operation, how do I 'scroll up/down a bit'
>programmatically ?

With sufficient desperation, you could try embedding the Table in an
iframe embedded in your existing page, which might allow you in effect
to use the scrolling functions of the iframed body element to scroll
just the Table.  Untested.

Alternatively, you might be able to put at the beginning of the Table a
row whose height in pixels is controlled by CSS & JavaScript; then
scroll the Table as you already do to the right region and then ease it
up or down by altering the first row height by a few pixels.

Except that you should use not px but em or ex for those, since your
valuable readers might be using the esteemed Zoom Text Only mode of
Firefox & (IIRC) Safari.

-- 
 (c) John Stockton, nr London, UK.  For Mail, see Home Page.  Turnpike, WinXP.
 Web  <http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and links.
 Command-prompt MiniTrue is useful for viewing/searching/altering files. Free,
 DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.

[toc] | [prev] | [next] | [standalone]


#16634

From"Mel Smith" <med_cutout_syntel@aol.com>
Date2012-10-14 08:45 -0600
Message-ID<ae01goFt5tpU1@mid.individual.net>
In reply to#16621
Dr. J said:
>
> With sufficient desperation, you could try embedding the Table in an
> iframe embedded in your existing page, which might allow you in effect
> to use the scrolling functions of the iframed body element to scroll
> just the Table.  Untested.
>
> Alternatively, you might be able to put at the beginning of the Table a
> row whose height in pixels is controlled by CSS & JavaScript; then
> scroll the Table as you already do to the right region and then ease it
> up or down by altering the first row height by a few pixels.
>
> Except that you should use not px but em or ex for those, since your
> valuable readers might be using the esteemed Zoom Text Only mode of
> Firefox & (IIRC) Safari.
>
> -- 
> (c) John Stockton, nr London, UK.  For Mail, see Home Page.  Turnpike, 
> WinXP.
> Web  <http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and 
> links.
> Command-prompt MiniTrue is useful for viewing/searching/altering files. 
> Free,
> DOS/Win/UNIX now 2.0.6; see 
> <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.


Dr. J:

    Please see my earlier post.  Danny gave me a good, quick solution which 
I implemented.

Thanks anyway for the response.

-Mel

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web