Solved

html grid and scroll bar question

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now