473,321 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 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 2334
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.