Hier noch meine (komprimierte) Variante die alte IE-Browser beachtet und konfigurierbar ist
und keine Grafik und kein Font-Icon benutzt:
Javascript://BOC conf
var ss = 220; //start to show when x px scrolled down
var fi = 1000; //fade in time
var st = 0; //scroll to
var sti = 800; //scroll time
//EOC conf
function getIEversion(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}$(function(){$(window).scroll(function(){var a=$(this).scrollTop(),b=getIEversion();b>-1&&8>=b?a>ss?$("#to-top").show():$("#to-top").hide():a>ss?$("#to-top").fadeIn(fi):$("#to-top").fadeOut(fi)}),$("#to-top").click(function(){$("body,html").animate({scrollTop:st},sti)})});
HTML:<p id="to-top" title="to top">∧</p>
(Das Zeichen ∧ sieht so aus ∧ .)
[ Für Gäste sind keine Dateianhänge sichtbar ]
CSS:#to-top {
display: none;
width: 25px;
height: 25px;
line-height: 20px;
font-size: 22px;
font-weight: bold;
text-align: center;
position: fixed;
bottom: 20px;
right: 20px;
color: #800;
text-shadow: 0 0 1px #B82D2D;
border: 2px solid #fff;
border-radius: 50%;
box-shadow: 0 0 6px #767676 inset, 0 0 8px #767676;
background: rgba(255,255,255,.6);
cursor: pointer;
}
#to-top:hover {color:#008020;}
(Die
line-height muß je nach Schriftart justiert werden.)
Gruß,
noRiddle