[go: up one dir, main page]

Menu

[r3949]: / float_button.js  Maximize  Restore  History

Download this file

28 lines (24 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!-- Original: Richard Cleaver (richard@cleaver.org.uk) -->
<!-- Web Site: http://www.cleaver.org.uk -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function floatButton () {
if (document.all) {
document.all.topButton.style.pixelTop = Math.max(getAbsolutePosition(document.getElementById('transcript_header')).y + 40, document.body.scrollTop);
document.all.topButton.style.pixelLeft = document.body.clientWidth - document.all.topButton.offsetWidth;
}
else if (document.layers) {
document.topButton.top = Math.max(getAbsolutePosition(document.getElementById('transcript_header')).y + 40, window.pageYOffset);
document.topButton.left = window.innerWidth - document.topButton.clip.width - 15;
}
else if (document.getElementById) {
document.getElementById('topButton').style.top = (Math.max(getAbsolutePosition(document.getElementById('transcript_header')).y + 40, window.pageYOffset)).toString() + 'px';
document.getElementById('topButton').style.left = (window.innerWidth - 120) + 'px';
}
}
if (document.all)
window.onscroll = floatButton;
else
setInterval ('floatButton()', 100);
// End -->