IT Community - Software Programming, Web Development and Technical Support

How do I move the scrollbar to a specific position?

This is a discussion on How do I move the scrollbar to a specific position? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... How do I move the scrollbar to a specific position? Thanks & Regards Pvinoth....


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-13-2007, 04:57 AM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 237
Pvinothkumar is on a distinguished road
Default How do I move the scrollbar to a specific position?

Hi all...

How do I move the scrollbar to a specific position?

Thanks & Regards
Pvinoth.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-13-2007, 07:30 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Re: How do I move the scrollbar to a specific position?

Hi Vinoth...

By using the window’s scrollTo() method. you can achive...

Example:

function moveToTop() {
self.scrollTo(0,0);
}


thnx...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-18-2007, 10:20 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: How do I move the scrollbar to a specific position?

HTMLElement.prototype.scrollBottom = function() {
var el = this; // element

var h = el.scrollHeight; // height of element scroll
var y = el.scrollTop; // vertical scroll offset from top (of scrollHeight)
var c = el.clientHeight; // scroll bar height

var scrollBottom = h - (y + c); // offset of scroll from bottom

return scrollBottom;
}
You can Refer this url also
Javascript - document.body and doctype switching
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-27-2007, 12:15 AM
GDevakii GDevakii is offline
D-Web Sr.Programmer
 
Join Date: Aug 2007
Posts: 138
GDevakii is on a distinguished road
Smile Re: How do I move the scrollbar to a specific position?

<html>
<body>
<input id=”Button1″ type=”button” value=”button” onclick=”foo();” />
<div style=”overflow:scroll; height:300px;” id=”mydiv” runat=”server”>
<div
style=” background-color:Red; height:800px;” >
<div style=”height:300px; background-color:Green;”>

</div>

</div>
</div>
</body>
</html>

In Page_Load
if (!ClientScript.IsClientScriptBlockRegistered(”mysc ript”))
{

System.Text.StringBuilder sBdr = new System.Text.StringBuilder();
sBdr.Append(”");
sBdr.Append(” function foo(){”);
sBdr.Append(” alert(document.getElementById(’” + mydiv.ClientID + “‘).scrollTop);”);
sBdr.Append(” }”);
sBdr.Append(”");
ClientScript.RegisterClientScriptBlock(typeof(Page ),”myscript”, sBdr.ToString());
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Manipulating scrollbar colors using CSS and JavaScript santhakumar HTML, CSS and Javascript Coding Techniques 1 11-27-2007 06:55 AM
Can we put the reference dll in to a specific folder? amansundar C# Programming 3 10-29-2007 12:51 AM
Is it possible to create colored scrollbar in the FIREFOX .... Archer HTML, CSS and Javascript Coding Techniques 2 07-27-2007 05:41 AM
goto specific scene nssukumar Flash Actionscript Programming 1 07-24-2007 01:14 AM
Set Position of Browsers Scrollbar using Javascript ? kingmaker HTML, CSS and Javascript Coding Techniques 1 07-19-2007 12:33 AM


All times are GMT -7. The time now is 12:13 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0