http://www.pennindy.com
Posted: Tue 21. Feb 2006, 03:16
Any suggestions on new features I can incorporate would be greatly appreciated!
The phpwcms support forum will help to find answers to your questions. The small but strong community is here since more than 10 years.
https://forum.phpwcms.org/
Code: Select all
// Script-Name: Flying Top
// Author: Johannes Meyknecht
// Contact: meyknecht@emediafabrik.de
//
//
// you can modify if you want. but please leave the original author information.
// from time to time it needs to update the browser checking for newer browsers.
// start position of the flying top
position_start = 0;
lastScrollY = 0;
// browser checking. update it, if newer browsers are available
NS = (document.layers) ? 1 : 0;
IE = (navigator.appName.indexOf("Microsoft Internet Explorer") != "-1") ? 1 : 0;
OP = ((document.getElementById) && (navigator.appName == "Opera")) ? 1 : 0;
MOZ = ((document.getElementById) && (navigator.appName == "Netscape")) ? 1 : 0;
Kon = (navigator.appName.indexOf("Konqueror") != "-1") ? 1 : 0;
if (IE) {
position = document.all.beamMeUp.style.pixelTop;
}
if (OP) {
position = document.getElementById("beamMeUp").style.pixelTop;
}
if (NS) {
position_start = 0;
position = document.beamMeUp.top;
}
if (MOZ) {
position = document.getElementById("beamMeUp").offsetTop;
}
if (Kon) {
position = document.getElementById("beamMeUp").offsetTop;
}
function abstand() {
if (IE || MOZ || Kon) { diffY = document.body.scrollTop; }
if (NS) { diffY = self.pageYOffset; }
if (OP) { diffY = document.getElementsByTagName("body") [0] .scrollTop; }
if (diffY != lastScrollY) {
// Hier Faktor f�r smooth-Scrolling anpassen
percent = .03 * (diffY - lastScrollY);
if (percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if (IE) {
position += percent;
document.all.beamMeUp.style.pixelTop = position + position_start;
}
if (OP) {
position += percent;
document.getElementById("beamMeUp").style.pixelTop = position + position_start;
}
if (NS) {
position += percent;
document.beamMeUp.top = position + position_start;
}
if (MOZ || Kon) {
position += percent;
document.getElementById("beamMeUp").style.top = position + position_start;
}
lastScrollY = lastScrollY + percent;
//window.status=lastScrollY;
}
}
if (NS || IE || OP || MOZ || Kon) action = window.setInterval("abstand()",1);
Code: Select all
<div id="beamMeUp" style="position: absolute; top: 362px; width: 15px;" align="right">
<a href="#top"> <img src="img/indy/totop.gif" alt="to top" border="0"> </a>
</div>
<script type="text/javascript" src="flyingtop.js">
</script>
nice looking sitetbuley wrote:Any suggestions on new features I can incorporate would be greatly appreciated!