skusam to aj takto:
Kód:
<div id="sipkaHore" style="display:block; "> <a href="#">
<span> <script type="text/javascript">
$("#sipkaHore")(window).scroll(function() {
if($(window).scrollTop() > 0) { // zistujes ci si uplne hore. popripade mozes zmenit 0 na vacsie cislo ak sa to ma zobrazit s 'oneskorenim'
$("#sipkaHore").fadeIn(); // zobrazis sipku
}
else {
$("#sipkaHore").fadeOut(); // skryjes sipku
}
});
$("#sipkaHore").click(function(e){
e.preventDefault();
$('html, body').animate({ scrollTop: 0 }, 300);
)};
</script> </span> </a> </div>
a css:
Kód:
#sipkaHore {
position: fixed;
bottom: 90px;
right: 20px;
z-index: 99;
}
#sipkaHore span {
width: 51px;
height: 51px
display: block;
margin-bottom: 7px
background:url(../images/images.png) no-repeat center center;
opacity: 1;
-webkit-transition: 0.2s ;
-moz-transition: 0.2s ;
transition: 0.2s ;
}
#sipkaHore a {
text-align: center;
font-size: 12px;
line-height: 20px;
font-family: arial;
text-transform: none;
color: #858585;
}
css si potom doladim, len potrebujem rozbehat funkciu.
Pomoze niekto?
D.