PDA

View Full Version : multiple scrollable iframes


Johny159
02-09-2003, 12:13 PM
this is a code i use to scroll an iframe
but you probably what happens when i put several iframes, they all scroll in the same time, how can i use this on several iframes on a page


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><iframe name="content"bgcolor="#E9ECF1" src="content.htm" width="200" height="194" frameborder="0" scrolling=no></iframe></td>
<td><img src="scroll.gif" width="13" height="194" border="0" usemap="#Map"></td>
</tr>
</table>

</td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="2,183,13,195" href="#" onMouseover="scrollspeed=2" onMouseout="scrollspeed=0">
<area shape="rect" coords="0,2,13,10" href="#" onMouseover="scrollspeed=-2" onMouseout="scrollspeed=0">
</map>
</body>
</html>

Mhtml
02-09-2003, 01:28 PM
Just target the specific frame.

<ifram name="MyFrame" ...

<area coords="2, 4, 88, 90" href="#" target="MyFrame" ...

Johny159
02-09-2003, 05:09 PM
tried that already, it didn't work, but i'll try again ;)
thanks anyway

Johny159
02-09-2003, 05:41 PM
forgot to say, i have this piece of code in the page that's loaded in the iframe


<script language="JavaScript1.2">

//Scrollable content III- By http://www.dynamicdrive.com

var speed, currentpos=curpos1=0,alt=1,curpos2=-1

function initialize(){
if (window.parent.scrollspeed!=0){
speed=window.parent.scrollspeed
scrollwindow()
}
}

function scrollwindow(){
temp=(document.all)? document.body.scrollTop : window.pageYOffset
alt=(alt==0)? 1 : 0
if (alt==0)
curpos1=temp
else
curpos2=temp

window.scrollBy(0,speed)
}

setInterval("initialize()",15)

</script>