floating layer

by "Hillary K. Norfleet" <hillarynorfleet(at)home.com>

 Date:  Mon, 13 Aug 2001 09:33:50 -0400
 To:  <hwg-techniques(at)hwg.org>
  todo: View Thread, Original
Hoping someone can help me out with a most vexing problem.  On this test
page http://dreampilot.net/test/test.html I have a script that pulls out a
view of a (test) shopping cart from the left side of the screen.  I am
attempting to use js in order to have the pull tab and cart view float along
when the page is scrolled vertically.  I've found a script (I'm programably
challenged) to do this and am asking for a bit of help tweaking it.  Right
now the script is making the entire screen stay in the upper viewing area,
even when scrolled.  That's in IE.  NS just hangs up trying to load the
page.  So I need to make this float the layer instead of the entire window.

Here is the script I've got to tweak:

function floatButton () {
if (document.all) {
document.all.topButton.style.pixelTop = document.body.scrollTop;
}
else if (document.layers) {
document.topButton.top = window.pageYOffset;
}
else if (document.getElementById) {
document.getElementById('topButton').style.top = window.pageYOffset + 'px';
   }
}
if (document.all)
window.onscroll = floatButton;
else
setInterval ('floatButton()', 100);
function initButton () {
if (document.all) {
document.all.topButton.style.pixelLeft = document.body.clientWidth -
document.all.topButton.offsetWidth;
document.all.topButton.style.visibility = 'visible';
}
else if (document.layers) {
document.topButton.left = window.innerWidth -
document.topButton.clip.width - 15;
document.topButton.visibility = 'show';
}
else if (document.getElementById) {
document.getElementById('topButton').style.left = (window.innerWidth - 35) +
'px';
document.getElementById('topButton').style.visibility = 'visible';
   }
}

Any assistance greatly appreciated!

Hillary

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA