Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to Scroll 2 frames?

Posted on 2003-02-27
7
Medium Priority
?
200 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
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
Technology Partners: 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
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

580 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