Solved

html grid and scroll bar question

Posted on 2011-03-17
1
686 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

710 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