You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Jamie Lerner <ja...@yahoo.com> on 2003/10/06 03:58:20 UTC

How do I Scroll to the top of portlet?

I have a number of JSPs and HTML in IFramePortlets
that are fairly long and do not fit on to one screen. 
When I have scrolled down on one portlet, and navigate
to a new page, the portlet remains at it's scroll
point, so that I have to scroll up each time I
navigate to a new page.

Is there a piece of code I can put into each JSP or
HTML to cause the page to scroll to the top when the
page is loaded within a an IFramePortlet?

Thanks in advance for the help.

JJL.

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: How do I Scroll to the top of portlet?

Posted by Jamie Lerner <ja...@yahoo.com>.
This is happening on the IE 6.0.28, but seems to
happen on all versions of IE.

Your suggestions will work for the HTML that I
control, but in cases where I don't control the HTML,
is there a flag or something I can set in the
IFramePortlet?

Thanks,

JJL.
--- Tim Reilly <ti...@consultant.com> wrote:
> What browser(s) does it happen in?
> 
> If you control the jsp(s) and html(s) you might try
> making the links go to a
> named anchor.
> For example in your jsp's have a pagetop anchor
> <a name="pagetop"/>
> then link to each page using the
> http://somedomain.org/next.jsp#pagetop
> ....
> you could also use script in each of those pages
> (this should work in most
> cases);
> for example:
> 
> <script language="javascript">
> function scrollUp(){
>       if(window.scrollTo){
>          window.scrollTo(0,0);
>       } else {
>          document.location.hash = "pagetop";
>       }
>    }
>   document.onload = setScrollUp();
> 
>   function setScrollUp(){
>   setTimeout("scrollUp()",100);
>   }
> </script>
> </head>
> <body><a name="pagetop"/>
> 
> --------
> HTH
> -Tim
> 
> > -----Original Message-----
> > From: Jamie Lerner [mailto:jamesjlerner@yahoo.com]
> > Sent: Sunday, October 05, 2003 9:58 PM
> > To: jetspeed-user@jakarta.apache.org
> > Subject: How do I Scroll to the top of portlet?
> >
> >
> > I have a number of JSPs and HTML in IFramePortlets
> > that are fairly long and do not fit on to one
> screen.
> > When I have scrolled down on one portlet, and
> navigate
> > to a new page, the portlet remains at it's scroll
> > point, so that I have to scroll up each time I
> > navigate to a new page.
> >
> > Is there a piece of code I can put into each JSP
> or
> > HTML to cause the page to scroll to the top when
> the
> > page is loaded within a an IFramePortlet?
> >
> > Thanks in advance for the help.
> >
> > JJL.
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product
> search
> > http://shopping.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> jetspeed-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> jetspeed-user-help@jakarta.apache.org
> >
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> jetspeed-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: How do I Scroll to the top of portlet?

Posted by Tim Reilly <ti...@consultant.com>.
What browser(s) does it happen in?

If you control the jsp(s) and html(s) you might try making the links go to a
named anchor.
For example in your jsp's have a pagetop anchor
<a name="pagetop"/>
then link to each page using the http://somedomain.org/next.jsp#pagetop
....
you could also use script in each of those pages (this should work in most
cases);
for example:

<script language="javascript">
function scrollUp(){
      if(window.scrollTo){
         window.scrollTo(0,0);
      } else {
         document.location.hash = "pagetop";
      }
   }
  document.onload = setScrollUp();

  function setScrollUp(){
  setTimeout("scrollUp()",100);
  }
</script>
</head>
<body><a name="pagetop"/>

--------
HTH
-Tim

> -----Original Message-----
> From: Jamie Lerner [mailto:jamesjlerner@yahoo.com]
> Sent: Sunday, October 05, 2003 9:58 PM
> To: jetspeed-user@jakarta.apache.org
> Subject: How do I Scroll to the top of portlet?
>
>
> I have a number of JSPs and HTML in IFramePortlets
> that are fairly long and do not fit on to one screen.
> When I have scrolled down on one portlet, and navigate
> to a new page, the portlet remains at it's scroll
> point, so that I have to scroll up each time I
> navigate to a new page.
>
> Is there a piece of code I can put into each JSP or
> HTML to cause the page to scroll to the top when the
> page is loaded within a an IFramePortlet?
>
> Thanks in advance for the help.
>
> JJL.
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org