Eike Hein: Objekt unten halten

Beitrag lesen

Dazu müßten wir was sehen. Kannst Du das entsprechende Teil des Skriptes mal vorlegen?

Klaro. Mein Problem ist dies, ich möchte das Script in ein Dokument einbauen, in dem schon ein Script ist. Hier das Geo Script:

<HTML>
<HEAD>
<TITLE>Slide script</TITLE>
<style>
body{background-color:#000000; font-family: Verdana, Arial,sans-serif; font-size:10pt; color:#1E6841}
A{color:#E1E1E1; text-decoration:none}
A:hover{color:blue}
A:visited:{color:#808080}
A.back{}
P{font-family: Verdana, Arial,sans-serif; font-size:10pt; color:#1E6841; font-weight:bold}
#divMain{position:absolute; left:50; top:50; font-family: Verdana, Arial,sans-serif; font-size:10pt; color:#1E6841; font-weight:bold}
</style>
<script>
//code mady by www.bratta.com can be used freely as long as this msg is intact
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;

function makeObj(obj,nest){  

nest=(!nest) ? '':'document.'+nest+'.'
     this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')  
     this.evnt=(n)? eval(nest+'document.'+obj):eval(obj);      
  this.moveIt=b_moveIt;
  
}
function b_moveIt(x,y){
  this.x=x; this.y=y
     this.css.left=this.x
  this.css.top=this.y
}
var pageWidth,pageHeight
function init(){
oTest=new makeObj('divBottom')
pageWidth=(ie)?document.body.offsetWidth-4:innerWidth;
pageHeight=(ie)?document.body.offsetHeight-2:innerHeight;
checkIt()
if(ie) window.onscroll=checkIt;

}
function checkIt(){
if(ie) oTest.moveIt(document.body.scrollLeft +pageWidth-200,document.body.scrollTop+pageHeight-50)
else if(n){
  oTest.moveIt(window.pageXOffset+pageWidth-200, window.pageYOffset+pageHeight-50)
  setTimeout('checkIt()',20)
}
}
</script>
</HEAD>

<BODY onload="init()">
<!-- just remove this : -->
<div id="divMain">
This works like the geocities thingy, the "www.bratta.com" will follow you when you scroll (tho you can't scroll here)?
</div>
<div id="divH2" style="position:absolute; top:0; height:10; font-size:12pt; font-weight:bold; font-family:verdana,arial; color:#303030">
Crossbrowser DHTML - geocities script
</div>

<!--Not this:-->
<div id="divBottom" style="position:Absolute; width:40; height:20"><b>www.bratta.com</b></div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
(JETZT KOMMEN NOCH HUNDERTE BRS)

</BODY>
</HTML>

Hier der Quelltext in den ich es eingebaut habe möchte:
(Die Kommentare waren für einen Kumpel)

<html>
<head>

<!-- ONMOUSEOVERSTYLE -->

<style type="text/css">
TD.just { text-align: justify }
A:hover { color: white }
</style>

<!-- ENDE ONMOUSEOVERSTYLE -->

</head>

<!-- BODY TAG-->
<body bgcolor="#000000" text=#10d100 link=#10d100 alink=#10d100 vlink=#10d100>
<!-- BODY TAG ENDE -->

<!-- AB HIER SCROLLSYSTEM, NICHT ÄNDERN -->

<script>
//made by www.bratta.com
//(the object idea came from the dynlayer (members.xoom.com/dynduo)

var n = (document.layers) ? 1:0;  
var ie = (document.all) ? 1:0;  
var loop, timer1, timer2;  

function makeObj(obj,nest){  

nest=(!nest) ? '':'document.'+nest+'.'
     this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
  this.up=goUp
  this.down=goDown
     this.obj = obj + "Object"
     eval(this.obj + "=this")
     return this
}
function goDown(speed){
  clearTimeout(timer1);clearTimeout(timer2)
  this.css.top=parseInt(this.css.top)+3
  if(loop) timer1=setTimeout(this.obj+".down("+speed+")",speed)

}  
function goUp(speed){  

clearTimeout(timer2);clearTimeout(timer1)
  this.css.top=parseInt(this.css.top)-3
  if(loop) timer2=setTimeout(this.obj+".up("+speed+")",speed)
}
function init(){
  testObj=makeObj('test2','test')
}
onload=init
</script>
<body>
<!-- just remove this : -->

<div id="down">

<a href="#" onmouseover="loop=true; testObj.down(5)" onmouseout="loop=false"><img src="up.gif" border=0></a>

</div>
<div id="up" style="position:absolute; right:20; top:50">

<a href="#" onmouseover="loop=true; testObj.up(5)" onmouseout="loop=false"><img src="down.gif" border=0></a><p>
</div>
<div id="test" style="position:absolute; width:500; top:50; left:50; clip:rect(0,600,100000,0)">
<div id="test2" style="position:relative; top:0; left:0">

<!-- SCROLLSYSTEM ENDE -->

<!-- AB HIER SEITENINHALT : -->

<!-- SEITENINHALT ENDE : -->

<!-- SCROLL SYSTEM, NICHT ÄNDERN : -->
</div>

</div>
<!-- ENDE SCROLLSYSTEM : -->

</body>
</html>