简体   繁体   English

jQuery自定义内容滚动条-触发scrollTop事件

[英]jQuery custom content scroller - trigger scrollTop Event

How to Trigger ScrollTop Event to make other plugins work with the custom content scroller 如何触发ScrollTop事件以使其他插件与自定义内容滚动条一起使用

I need to get some plugins to work which use scroll and scrollTop events from jquery and javascript. 我需要一些使用jquery和javascript的scroll和scrollTop事件的插件才能工作。 Is it possible to trigger these events without rewriting the plugins? 是否可以在不重写插件的情况下触发这些事件?

About the Custom content scroller events i found this: custom content scroller #Events 关于“自定义内容滚动器”事件,我发现了这一点: 自定义内容滚动器#Events

If not do you have an idea how i could find a workaround? 如果没有,您是否知道如何找到解决方法?

Plugin: Link to jQuery custom content scroller 插件: 链接到jQuery自定义内容滚动条

For jQuery 对于jQuery

$('.element').off('scroll').on('scroll', function () {
    var scrollTop = $(this).scrollTop();
    if(scrollTop == 0){
        console.log('ScrollTop');
    } else if (scrollTop + $(this).innerHeight() >= this.scrollHeight) {
        console.log('ScrollBottom');
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM