?
Solved

how to Scroll 2 frames?

Posted on 2003-02-27
7
Medium Priority
?
199 Views
Last Modified: 2008-03-04
I have this site with three frame top, main and left.
and i want the left frame to scroll together with main frame (but only if i scroll the main frame otherwise left frame should be unscrollable). Any ideas??   ooh and i want to scroll up and down.


0
Comment
Question by:DaddyCOOL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Author Comment

by:DaddyCOOL
ID: 8035073
You shoul use Cascading Style sheets, just include the following lines on your site

<html>
<head>


<style type="text/css">
a {text-decoration:none}
</style>



</head>
0
 
LVL 2

Expert Comment

by:weeezl
ID: 8035552
I'm not sure how familiar you are with javascript but that is the only way I know how to do this.

Information is here:

http://www.webreference.com/dhtml/column17/syncStep.html

Take a look and let me know if you need help implementing.
0
 

Expert Comment

by:zshipley
ID: 8035635
Instead of using conventional frames, you could include different "frames" using the <iframe> tag:
<iframe src="nav.html"></iframe>
It will scroll with the main scrollbar just like a normal page element.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:stebesplace
ID: 8035871
With zshipley's comment, make sure you make the nav frame borders = to 0, and set scrollable to 0 if you do not want it to look like a conventiional frame.

-Steve
0
 

Author Comment

by:DaddyCOOL
ID: 8035944
ok tnx but i found another way to do it...
onScroll="parent.leftFrame.scrollTo(0,document.body.scrollTop)"
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 200 total points
ID: 8038425
Srcolling two frames together:

There are two functions. One for scrolling up and one for scrolling down.
You could combine them by passing an argument but the additional overhead
of doing it that way would cause a performance problem on slower machines.

<script language="JavaScript">
<!--
var UPSCRL=false;
var DNSCRL=false;

function scrollPageU ()
{
window.scrollBy(0,2);
parent.leftframe.scrollBy(0,2);
}

function scrollPageD()
{
window.scrollBy(0,-2);
parent.leftframe.scrollBy(0,-2);
}
//-->

The frame declaration for the left frame in the frame set
would have to to be named. The function as written is assuming a
name of leftframe

To trigger the scroll we need an event. This is what it looks like
if we use mouse events and an image in an anchor.


<A HREF="JavaScript:null(0)"
onMouseover="UPSCRL=setInterval('scrollPageU()',10)"
OnMouseout="clearInterval(UPSCRL)">
<img src="up.gif" border=0>
</A>

<A HREF="JavaScript:null(0)"
onMouseover="DNSCRL=setInterval('scrollPageD()',10)"
OnMouseout="clearInterval(DNSCRL)">
<img src="down.gif" border=0>
</A>

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8048434
Glad I could help. Thanks for the A. :^)

Cd&
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question