返回顶部,右侧浮窗-25

<style>
        .rigFlo{position: fixed;bottom: 150px;right: 50%;margin-right: -720px;width: 108px;height: 99px;background: url(http://image.hc360.com/bw/oneRod/guidIcon.png) no-repeat 0px -183px;display: none;}

.rigFlo a{position: absolute;width: 65px;height: 40px;bottom: 2px;right: 11px;text-indent: -9999px;display: block;}
.rigFlo:hover{background: url(http://image.hc360.com/bw/oneRod/guidIcon.png) no-repeat -1px -2px;}

@media screen and (max-width: 1366px) {
    .rigFlo{position: fixed;bottom: 150px;right:0px;width: 108px;height: 99px;background: url(http://image.hc360.com/bw/oneRod/guidIcon.png) no-repeat 0px -183px;display: none;margin-right: 0;}
}

        </style>
        
        <!-- 右侧浮窗 -->
        <div class="rigFlo">
            <a href="javascript:;">返回顶部</a>
        </div>

        <script type="text/javascript" src="http://style.org.hc360.com/js/build/source/core/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).scroll(function() {
                if($(document).scrollTop() > 1600) {
                    $('.rigFlo').show();
                } else {
                    $('.rigFlo').hide()
                }
            })
            $('.rigFlo a').click(function() {
                $('body,html').animate({
                    scrollTop: 0
                }, 1000);
            })
        </script>

 

posted @ 2019-11-26 16:19  南瓜小园  阅读(138)  评论(0编辑  收藏  举报