Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Synchronize 2 frames

Reply
Thread Tools

Synchronize 2 frames

 
 
Gerard Jonker
Guest
Posts: n/a
 
      10-31-2003
Hello

I am trying to synchronize 2 frames with code as shown below but it
only works in IE5.2 for the Mac, in Safari or in IE6 for Windows it
does not work.
Is there a solution for this?

Gerard Jonker
The Netherlands



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>
frame scrolling synchronization
</TITLE>
<SCRIPT>
var tid;
function initScrollSynchronization () {
tid = setInterval('syncFrame()', 25);
}
function syncFrame () {
if (document.all && !window.opera) {
var scrollTop = frame0.document.body.scrollTop;
var scrollLeft = frame0.document.body.scrollLeft;
}
else {
var scrollTop = frame0.pageYOffset;
var scrollLeft = frame0.pageXOffset;
}
frame1.scrollTo (scrollLeft, scrollTop);
}
</SCRIPT>
</HEAD>
<FRAMESET COLS="50%, 50%" ONLOAD="initScrollSynchronization()">
<FRAME NAME="frame0" SRC="file1.html">
<FRAME NAME="frame1" SRC="file2.html">
</FRAMESET>
</HTML>

--
 
Reply With Quote
 
 
 
 
Leif K-Brooks
Guest
Posts: n/a
 
      10-31-2003
Gerard Jonker wrote:


> I am trying to synchronize 2 frames with code as shown below but it
> only works in IE5.2 for the Mac, in Safari or in IE6 for Windows it
> does not work.
> Is there a solution for this?


Don't use frames.
http://html-faq.com/htmlframes/?framesareevil
http://homepage.ntlworld.com/l_vajzo...eb/frames.html
http://dorward.me.uk/www/frames/

 
Reply With Quote
 
 
 
 
Gerard Jonker
Guest
Posts: n/a
 
      11-02-2003
In article <TYpob.1365$>, Leif K-Brooks
<> wrote:

> Gerard Jonker wrote:
>
>
> > I am trying to synchronize 2 frames with code as shown below but it
> > only works in IE5.2 for the Mac, in Safari or in IE6 for Windows it
> > does not work.
> > Is there a solution for this?

>
> Don't use frames.


Thanks for your advice, it was very useful to me.

I have created a construction with a single document using fixed
position elements. However, I want to be able to scroll part of the
document horizontally, while maintaining its vertical position. Is
there a way to do this using CSS? I have not found one in the official
CSS documentation.

Gerard Jonker
 
Reply With Quote
 
Lauri Raittila
Guest
Posts: n/a
 
      11-02-2003
In article Gerard Jonker wrote:
> In article <TYpob.1365$>, Leif K-Brooks
> <> wrote:
>
> > Gerard Jonker wrote:
> >
> >
> > > I am trying to synchronize 2 frames with code as shown below but it
> > > only works in IE5.2 for the Mac, in Safari or in IE6 for Windows it
> > > does not work.
> > > Is there a solution for this?

> >
> > Don't use frames.

>
> Thanks for your advice, it was very useful to me.


Nice to know. It usually doesn't help to imitate frames using CSS though.

> I have created a construction with a single document using fixed
> position elements.


I don't think that is best aproach. But I don't have any idea what you
are doing, so it is really hard to tell. If this is going to be normal
webpage for normal web audience, I think you need to rethink your
consept.

> However, I want to be able to scroll part of the
> document horizontally, while maintaining its vertical position. Is
> there a way to do this using CSS? I have not found one in the official
> CSS documentation.


This is almost possible using absolute positioning, and overflow:scroll.
Quick & dirty example:
http://www.student.oulu.fi/~laurirai...scrolling.html

The problem is that horizontal scrollbar is likely to be outside viewport
most of the time, so you need to assume people know how to scroll
horizontally whitout it. Too bad it is impossible in some browsers
(tested on O7.21). Using iFrame instead scrolling div would propably help
0.1% of normal web audience that know how to scroll horizontally whitout
scrollbar. Then you could add some JS scrollbar. But it wouldn't work for
lots of people. I don't think there is better way, unfortunately.

If you can scroll overflow:auto element using JS, I think it would be
somewhat easy to make it degrade well (whole page would be horizontally
scrolled). But I don't know if that is possible using JS+DOM.




--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
having a problem with scrolling frames as if no frames surfunbear@yahoo.com HTML 0 03-08-2006 09:54 PM
Frames and borders around specific frames meyousikmann@yahoo.com HTML 1 02-10-2006 11:12 PM
Frames or not Frames... Ale HTML 17 08-05-2005 12:10 AM
Link needed to go from a non-frames page to a Frames page, and load a particular frame. How? - Newbe Philip HTML 3 06-28-2004 03:06 PM
From Frames to no frames? Powerslave2112 HTML 2 01-20-2004 10:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57