Ciao an alle ... ich brauche Hilfe!!!
Ich habe folgendes javascript gefunden um einen Layer auf und abzubewegen, moechte aber auch, dass der Text (Layer) stehenbleibt, wenn er oben angelangt ist, bzw. wenn er unten angelangt ist ...
Wie und wo muss ich diese if-Abfrage einbauen ... waere schoen wenn mir jemand sehr detailliert weiterhelfen koennte, da ich nicht so fit bin.
DANKE ...
<SCRIPT>
function tmt_scrollLayerBy(bersaglio, dx, dy, vel) {
if (document.layers) {
turi = document.layers[bersaglio];
var cl = turi.clip.left;
var ct = turi.clip.top;
var cr = turi.clip.right;
var cb = turi.clip.bottom;
var l = turi.left;
var t = turi.top;
turi.clip.left = cl + dx;
turi.clip.top = ct + dy;
turi.clip.right = cr + dx;
turi.clip.bottom = cb + dy;
turi.top = t - dy;
turi.left = l - dx;
} else {
if (document.all) {
turi = eval("document.all." + bersaglio + ".style");
if (turi.clip) {
var clipv = turi.clip.split("rect(")[1].split(")")[0].split("px");
var ct = Number(clipv[0]);
var cr = Number(clipv[1]);
var cb = Number(clipv[2]);
var cl = Number(clipv[3]);
var l = turi.pixelLeft;
var t = turi.pixelTop;
}
ncl = cl + dx;
nct = ct + dy;
ncr = cr + dx;
ncb = cb + dy;
turi.pixelTop = t - dy;
turi.pixelLeft = l - dx;
eval("turi.clip = 'rect(' + nct + ' ' + ncr + ' ' + ncb + ' ' + ncl +')'");
}
}
tmt_scrollalo = setTimeout("tmt_scrollLayerBy('" + bersaglio + "'," + dx + "," + dy + "," + vel + ")", vel);
}
function tmt_stopScroll() {
if (tmt_scrollalo) {
clearTimeout(tmt_scrollalo);
}
}
if (document.layers) {origWidth = innerWidth; origHeight = innerHeight;}
function reDo() {if (innerWidth != origWidth innerHeight != origHeight)
location.reload();}
if (document.layers) onresize = reDo;
</SCRIPT>