IFrame scrollen mit Grafik

K

Kebb

Hallo,
ich habe auf einer Seite ein IFrame und dazu 2 Bilder (hoch.jpg und runter.jpg). Nun hätte ich gerne ein Script welches wenn ich das hoch-Bild mit der Maus gedrückt halte im IFrame hochscrollt und bei runter.jpg dem entsprechend runterscrollt. Ich habe das schon mit scrollBy bzw. scrollTo ausprobiert aber irgendwie ging das nicht richtig. Es hörte nicht auf zu scrollen wnn ich die Bilder losgelassen hatte. Kann mir da jemand helfen?

Das Script derzeit sieht in etwa so aus:
Code:
<script type="text/javascript">
<!--

      function bottom1(i) {

         while (i == 1){
             parent.frame.scrollBy(0, 1);
             setTimeout("bottom1(1)",1);
             if (i == 0){
                  break;
             }
         }         

      }
-->
</script>


<iframe src="info.php" scrolling="no" frameborder="0" name="frame"></iframe>
<img src="runter.jpg" onMouseDown="bottom1(1)" onMouseUp="bottom1(0)">
 
HTML:
<script type="text/javascript">
doloop = false;

function start()
{
	doloop = true;
	scroll();
}

function scroll()
{
	//mach was
	if(!doloop)
		return;
	setTimeout("scroll()",1);
}

function stop()
{
	doloop = false;
}
</script>
So sollts funktionieren.
 
Zurück