JSFiddle - React, Tailwind, and code Playground

by ZeNz0r

HTML

<link rel="stylesheet" href="///ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/base/jquery-ui.css">
<div id="scroller">
    asdfasdf
    asdf
    dasf
    asdfasdf
    asdfasd
    fasdf
    asdfas
    dfasdfasdf
</div>

CSS

#scroller {
    height: 100px;
    width: 100px;
    overflow: scroll
}

JavaScript

$('#scroller').scroll(function(e) {
    if ($(this).is(':animated')) {
        console.log('scroll happen by animate');
    } else if (e.originalEvent) {
        // scroll happen manual scroll
        console.log('scroll happen manual scroll');
    } else {
        // scroll happen by call
        console.log('scroll happen by call');
    }
});

$('#scroller').scroll();
$('#scroller').animate({scrollTop: 200}, 1000);