![]() | ![]() ![]() ![]() ![]() ![]() |
Beschreibung
Es wird der Scroll-Balken eines weiteren Browser-Fensters gesteuert.
Quelltext
<head>
<script language="JavaScript">
<!--
width=468;
height=60;
src="jvsfaban.gif";
win=null;
function start() {
win=window.open("","scroll_window","directories=0,location=0,menubar=0,resizeable=0,scrollbars=1,status=0,toolbar=0,width="+width+",height="+2*height);
if(win != null) {
href=window.location.href.toLowerCase();
href=href.substring(0, href.indexOf("scroll"));
win.document.write("<img src='"+src+"' width="+2*width+" height="+2*height+">");
win.document.close();
win.focus();
xpos=0;
} else {
alert("das ging in die Hose");
}
}
function stop() {
if(win != null && !win.closed)win.close();
}
function scroll(delta) {
if(win == null || win.closed)start();
if(win == null)return;
xpos=xpos+delta;
if(xpos < 0)xpos=0;
if(xpos > width)xpos=width;
win.scroll(xpos,0);
win.focus();
}
//-->
</script>
</head>
<body onUnload="stop()">
<form>
<input type=button value="Start" onClick="start();"><br>
<input type=button value="links" onClick="scroll(-30);">
<input type=button value="rechts" onClick="scroll(30);"><br>
<input type=button value="Stop" onClick="stop();">
</form>
</body>
Referenz
[scroll]
Auf der nächsten Seite erstellen wir ein sortierbares Telefonbuch |
![]() ![]() |