Solved

html grid and scroll bar question

Posted on 2011-03-17
1
685 Views
Last Modified: 2012-08-14
I know very little about html and JS so please excuse the stupid question.

I have an application (written in Delphi/Intraweb) that produces a grid with a scrollbar.

I am not sure what type of object this is in the browser.  Perhaps it is two - I dont know.

However I would like to scroll the scrollbar to the top when a user clicks on a button.  Can this be done in JS?
0
Comment
Question by:soozh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
Finec earned 500 total points
ID: 35156744
If you want to scroll the full page, use this:

// horizontal 0 and vertical 0
window.scrollBy(0,0);

Open in new window


Or if it's in an overlayed div, give an id to the div, and use this:

document.getElementById('yourDivId').scrollTop = 0;

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question