danl linehan
05-26-2004, 08:20 PM
not sure exactly what it is called, but i've put a scrolling image in the bottom corner of this site:
http://www.kjdenhert.com/new/simon/index.html
it's the first time i've tried to use this feature, so i'm not at all familiar with the way it actually works (i borrowed to code)... i've been futsing with the script trying to get the image to scroll on the bottom LEFT corner rather than the right corner, but i can't figure out how to do it...
my script is as follows... any help would be greatly appreciated... thank you!!!
<script language="JavaScript"><!--
function DOMGetElement(o) {
if (document.getElementById) return document.getElementById(o);
else if (document.all) return document.all[o];
else if (document.layers) return document.layers[o];
return null;
}
function DOMWindowGetXOffset() {
if (document.all) return document.body.scrollLeft;
else if (document.getElementById) return window.pageXOffset;
else if (document.layers) return window.pageXOffset;
}
function DOMWindowGetYOffset() {
if (document.all) return document.body.scrollTop;
else if (document.getElementById) return window.pageYOffset;
else if (document.layers) return window.pageYOffset;
}
function DOMElementSetTopPos(o,val) {
if (document.getElementById) o.style.top = val;
else if (document.all) o.style.top = val;
else if (document.layers) o.pageY = val;
}
function DOMElementSetLeftPos(o,val) {
if (document.getElementById) o.style.left = val;
else if (document.all) o.style.left = val;
else if (document.layers) o.pageX = val;
}
function DOMWindowGetInnerWidth() {
if (document.all) return document.body.clientWidth;
else if (document.getElementById) return window.innerWidth;
else if (document.layers) return window.innerWidth;
}
function DOMWindowGetInnerHeight() {
if (document.all) return document.body.clientHeight;
else if (document.getElementById) return window.innerHeight;
else if (document.layers) return window.innerHeight;
}
function DOMElementGetHeight(o) {
if (document.all) return o.clientHeight;
else if (document.getElementById) return parseInt(o.offsetHeight);
else if (document.layers) return o.document.height;
}
function DOMElementGetWidth(o) {
if (document.all) return o.clientWidth;
else if (document.getElementById) return parseInt(o.offsetWidth);
else if (document.layers) return o.document.width;
}
function pageOffset() {
var o = DOMGetElement('o');
if (o) {
DOMElementSetLeftPos(o, DOMWindowGetXOffset() + DOMWindowGetInnerWidth() - DOMElementGetWidth(o) - 0);
DOMElementSetTopPos(o, DOMWindowGetYOffset() + DOMWindowGetInnerHeight() - DOMElementGetHeight(o) - 0);
setTimeout('pageOffset()',10);
}
}
//--></script>
http://www.kjdenhert.com/new/simon/index.html
it's the first time i've tried to use this feature, so i'm not at all familiar with the way it actually works (i borrowed to code)... i've been futsing with the script trying to get the image to scroll on the bottom LEFT corner rather than the right corner, but i can't figure out how to do it...
my script is as follows... any help would be greatly appreciated... thank you!!!
<script language="JavaScript"><!--
function DOMGetElement(o) {
if (document.getElementById) return document.getElementById(o);
else if (document.all) return document.all[o];
else if (document.layers) return document.layers[o];
return null;
}
function DOMWindowGetXOffset() {
if (document.all) return document.body.scrollLeft;
else if (document.getElementById) return window.pageXOffset;
else if (document.layers) return window.pageXOffset;
}
function DOMWindowGetYOffset() {
if (document.all) return document.body.scrollTop;
else if (document.getElementById) return window.pageYOffset;
else if (document.layers) return window.pageYOffset;
}
function DOMElementSetTopPos(o,val) {
if (document.getElementById) o.style.top = val;
else if (document.all) o.style.top = val;
else if (document.layers) o.pageY = val;
}
function DOMElementSetLeftPos(o,val) {
if (document.getElementById) o.style.left = val;
else if (document.all) o.style.left = val;
else if (document.layers) o.pageX = val;
}
function DOMWindowGetInnerWidth() {
if (document.all) return document.body.clientWidth;
else if (document.getElementById) return window.innerWidth;
else if (document.layers) return window.innerWidth;
}
function DOMWindowGetInnerHeight() {
if (document.all) return document.body.clientHeight;
else if (document.getElementById) return window.innerHeight;
else if (document.layers) return window.innerHeight;
}
function DOMElementGetHeight(o) {
if (document.all) return o.clientHeight;
else if (document.getElementById) return parseInt(o.offsetHeight);
else if (document.layers) return o.document.height;
}
function DOMElementGetWidth(o) {
if (document.all) return o.clientWidth;
else if (document.getElementById) return parseInt(o.offsetWidth);
else if (document.layers) return o.document.width;
}
function pageOffset() {
var o = DOMGetElement('o');
if (o) {
DOMElementSetLeftPos(o, DOMWindowGetXOffset() + DOMWindowGetInnerWidth() - DOMElementGetWidth(o) - 0);
DOMElementSetTopPos(o, DOMWindowGetYOffset() + DOMWindowGetInnerHeight() - DOMElementGetHeight(o) - 0);
setTimeout('pageOffset()',10);
}
}
//--></script>