Menu

#574 Retornar al top de la pagina

Not planned
open
nobody
None
5
2017-02-24
2017-02-24
No

Pequeña funcionalidad que se activa al momento de generarse un scroll horizontal.
Las pruebas las realice dentro de OXPro y seria interesante que fuera incluido dentro del core de OX.

En index.jsp

<a href="#" class="top_scroll">Scroll</a>

En la misma pagina el siguiente script

$(document).ready(function () {
            $(window).scroll(function () {
                if ($(this).scrollTop() > 100) {
                    $('.top_scroll').fadeIn();
                } else {
                    $('.top_scroll').fadeOut();
                }
            });
            $('.top_scroll').click(function () {
                $("html, body").animate({
                    scrollTop: 0
                }, 600);
                return false;
            });
        });

en custom.css

.top_scroll {   
    width: 32px;
    height: 32px;
    position: fixed;
    bottom: 6px;
    right: 21px;
    display: none;
    text-indent: -9999px;
    background: url("../images/icon_top.png") no-repeat;
    background-color: #FFFFFF;
}
1 Attachments

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.