MyBB.de Forum
Scroll top and bottom - Druckversion

+- MyBB.de Forum (https://www.mybb.de/forum)
+-- Forum: Anpassungen (https://www.mybb.de/forum/forum-47.html)
+--- Forum: Theme-Diskussionen (https://www.mybb.de/forum/forum-84.html)
+--- Thema: Scroll top and bottom (/thread-31992.html)



Scroll top and bottom - hkkp - 10.05.2015

headerinclude:

PHP-Code:
<script type="text/javascript">
jQuery(document).ready(function(jQ){
    appear();
    
    jQ
(window).scroll(function(){
        appear();
    });
                      
    
function appear() {
        if (jQ(this).scrollTop() > 200) {
            jQ('#scroll_up').fadeIn('slow');
        } else {
            jQ('#scroll_up').fadeOut('slow');
        }
        if (jQ(this).scrollTop() < (jQ('body').height() - (200+jQ(window).height()))) {
            jQ('#scroll_dn').fadeIn('slow');
        } else {
            jQ('#scroll_dn').fadeOut('slow');
        }
    };
    
    jQ
('#scroll_up').click(function(){
        jQ('body').stop().animate({scrollTop0}, 600);
    });
    jQ('#scroll_dn').click(function(){
        jQ('body').stop().animate({scrollTopjQ('body').height()}, 600);
    });
});
</
script

global.css:

Code:
#scroll_up, #scroll_dn {
  position: fixed;
  right: 5px;
  width: 35px;
  height: 35px;
  cursor: pointer;
  display: none;
  z-index: 999;
  background:  #026CB1 url(../../../images/sc_arrow.png) center no-repeat;
}
#scroll_up {
    bottom: 50px;
}
#scroll_dn {
    bottom: 10px;
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    transform: rotate(180deg);
}

footer:

PHP-Code:
<span id='scroll_up'></span><span id='scroll_dn'></span


es wird alles angezeigt, aber wieso hüpft der nicht nach oben oder unten?


RE: Scroll top and bottom - MrBrechreiz - 10.05.2015

Nimm lieber dies

http://www.jqueryscript.net/other/jQuery-Plugin-For-Smooth-Scroll-To-Top-Bottom-scrollToTop.html


RE: Scroll top and bottom - hkkp - 10.05.2015

mmmhhh, wenn ich es denn mal sehen würde...


RE: Scroll top and bottom - MrBrechreiz - 10.05.2015

Da ist ein Button, der nennt sich DEMO ^^


RE: Scroll top and bottom - hkkp - 10.05.2015

hat sich erledigt...


RE: Scroll top and bottom - MrBrechreiz - 10.05.2015

In wie fern ?


RE: Scroll top and bottom - hkkp - 11.05.2015

nur mit dem link in der mitte will nicht so... weil wenn ich dann auf die mitte klicke, dann will er mich zu true weiterleiten...


RE: Scroll top and bottom - hkkp - 16.05.2015

(10.05.2015, 22:22)MrBrechreiz schrieb: Nimm lieber dies

http://www.jqueryscript.net/other/jQuery-Plugin-For-Smooth-Scroll-To-Top-Bottom-scrollToTop.html

hab das genommen. funktionier sehr gut. danke!