JavaScript Source Code 3000: Page Details: Floating Link
Floating Link
This link will float in the upper right corner of the browser window and return you to the top of the window when clicked. Easily modified to include floating text or image!
Back to Top
JavaScript Source Code 3000: Page Details: Floating Link
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Command-s). The script is yours!!!
<!-- THREE STEPS TO INSTALL FLOATING LINK:
1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Richard Cleaver (richard@cleaver.org.uk) -->
<!-- Web Site: http://www.cleaver.org.uk -->
<! >
<! >
<!-- Begin
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';
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="initButton()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<SPAN ID="topButton" STYLE="position: absolute; visibility: hidden; top: 0px;">
<A HREF="javascript: window.scrollTo(0, 0); void 0" ONMOUSEOVER="window.status = 'top'; return true;" ONMOUSEOUT="window.status = ''; return true;">Back to Top</A>
</SPAN>
<!-- Script Size: 2.14 KB -->
Wyszukiwarka
Podobne podstrony:
linklinklink link DYM efekty video z dymem40 97 Lower guide link remove & installAlpha Floating PointSH Floating Pointwięcej podobnych podstron