472,960 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,960 software developers and data experts.

Scroll 2 windows at once in IE7

7
Hi Guys,

I'm writing a little webbased application for my bosses at work which utilises PHP, Javascript and HTML.
I have very little knowledge of javascript itself but I found a script that allowed 2 seperate frames on 1 page to be scrolled at the same time, which I needed as I am showing table row headers in 1 small side column and the rest of the table in the main window but as its taller than the page they need to scroll at the same time.

On me loading my frameset the script works fine and both windows scroll together exactly how I would like, I then tell it to load my table into the main frame window and then load the row headers in to the side column and it no longer scrolls together which is an issue to say the least. I have included the code on the page I am opening and in Firefox and Konqueror the script works as I would like when I click on the link.

The script is as follows:
Expand|Select|Wrap|Line Numbers
  1. var _run;
  2. if(navigator.userAgent.indexOf("Firebird")!=-1||navigator.appName=="Microsoft Internet Explorer")
  3. {_run=false;}
  4. else {_run= true;}
  5.  
  6. function vScroll()
  7. {
  8. var top = (window.pageYOffset)?(window.pageYOffset):(document.documentElement)?document.documentElement.scrollTop:document.body.scrollTop; 
  9.  
  10. parent.frames["right"].scrollTo(0,top);
  11.  
  12. }
  13.  
  14. function searchScroll(){
  15. var top = (window.pageYOffset)?(window.pageYOffset):(document.documentElement)?document.documentElement.scrollTop:document.body.scrollTop;
  16.  
  17. parent.frames["right"].scrollTo(0,top);
  18.  
  19. window.setTimeout("searchScroll();",1);
  20.  
  21. }
  22. if(_run == false)
  23. {
  24. window.onscroll=function(){vScroll();} 
  25. } else { 
  26. window.onload=function(){searchScroll()}
  27. }
  28.  
You put this at the top of the page you would like to be in control of the scrolling the the rest works like magic, just not when you start reopening pages in IE.

If there a way around this or a better solution??

Cheers

Tom
May 11 '07 #1
1 2326
iam_clint
1,208 Expert 1GB
what do you mean by reopening? refreshing the page?
May 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Devonish | last post by:
I have a form designed as a Continuous form which displays one record per line. Taking account of the header and footer and the size of the screen, I can display 30 records at a time. I can see...
3
by: Devonish | last post by:
I have a form designed as a Continuous form which displays one record per line. Taking account of the header and footer and the size of the screen, I can display 30 records at a time. I can see...
1
by: Gidi | last post by:
hello i have a DataGrid table and by the help of Adnan, here in the forum, i have the Mouse_up Event that by Clicking a row on the dataGrid it's selectes the whole ro the problem is when i'm...
0
by: Rachel | last post by:
I am developing an application for Windows Mobile devices using C#. I have a form that has several controls (labels and textboxes that are dynamically created on opening the form) and a vertical...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.