固定按钮失去功能后滚动

Fixed Button Loses Functionality After Scrolling

本文关键字:滚动 功能 失去 按钮      更新时间:2023-09-26

这是我的代码:

$(window).scroll(function() {
        var currentScroll = $(window).scrollTop();
        if (currentScroll >= 75) {
            $('#ticketDetailsButtons').css({
                position: 'fixed',
                top: 75
            });
        } else {
            $('#ticketDetailsButtons').css({
                position: 'static'
            });
        }
    });

在它的位置值被改变为静态后,我不能再点击它了,我只能看到它。什么好主意吗?

小提琴:http://jsfiddle.net/wzp7f/

我猜您有另一个具有更高z-index的元素覆盖按钮。将有助于看到你的HTML。