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  
Old 07-18-2007, 09:34 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 881
kingmaker is on a distinguished road
Send a message via MSN 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
  #2  
Old 07-18-2007, 11:33 PM
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 Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cool ScrollBar Compnent ramesharthanari Flash Actionscript Programming 0 07-15-2008 04:21 AM
Manipulating scrollbar colors using CSS and JavaScript santhakumar HTML, CSS and Javascript Coding Techniques 1 11-27-2007 05: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 09:28 PM
How do I move the scrollbar to a specific position? Pvinothkumar HTML, CSS and Javascript Coding Techniques 3 10-26-2007 11:15 PM
What browsers support JavaScript, and where can I find documentation? Pvinothkumar HTML, CSS and Javascript Coding Techniques 1 09-17-2007 10:15 PM


All times are GMT -7. The time now is 08:24 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0