IT Community - Software Programming, Web Development and Technical Support

Set Position of Browsers Scrollbar using Javascript ?

This is a discussion on Set Position of Browsers Scrollbar using Javascript ? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Set Position of Browsers Scrollbar using Javascript ?...


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 07-18-2007, 10:34 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 Set Position of Browsers Scrollbar using Javascript ?

Set Position of Browsers Scrollbar using Javascript ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-19-2007, 12:33 AM
Archer Archer is offline
D-Web Programmer
 
Join Date: Jun 2007
Posts: 52
Archer is on a distinguished road
Default Re: Set Position of Browsers Scrollbar using Javascript ?

Here is code for setting the Browser scrollbar position

<HTML>
<body onload="javascript:ScrollIt()" onscroll="javascript:setcoords()">
<form id="Form1" method="post" runat="server">
...Page Content...
<input type=hidden id=PageX name=PageX value=0 runat=server>
<input type=hidden id=PageY name=PageY value=0 runat=server>
</form>
<script language=javascript>
function ScrollIt(){
window.scrollTo(document.Form1.PageX.value, document.Form1.PageY.value);
}
function setcoords(){
var myPageX;
var myPageY;
if (document.all){
myPageX = document.body.scrollLeft;
myPageY = document.body.scrollTop;
}
else{
myPageX = window.pageXOffset;
myPageY = window.pageYOffset;
}
document.Form1.PageX.value = myPageX;
document.Form1.PageY.value = myPageY;
}
</script>
</body>
</HTML>
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 I get javascript to determine a browsers font setting and alter srikumar_l HTML, CSS and Javascript Coding Techniques 0 11-21-2007 10:28 PM
How do I move the scrollbar to a specific position? Pvinothkumar HTML, CSS and Javascript Coding Techniques 3 10-27-2007 12:15 AM
What browsers support JavaScript, and where can I find documentation? Pvinothkumar HTML, CSS and Javascript Coding Techniques 1 09-17-2007 11:15 PM
Is it possible to create colored scrollbar in the FIREFOX .... Archer HTML, CSS and Javascript Coding Techniques 2 07-27-2007 05:41 AM


All times are GMT -7. The time now is 09:23 AM.


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

SEO by vBSEO 3.0.0