简体   繁体   中英

Bind scroll event to select element using angularjs

I am new to angularjs. And i dont know how to bind scroll event to the html element select .this is my directive to adding scrolling functionality.

myApp.directive('scrolly', function () {
    return {
        restrict: 'A',
        link: function (scope, element, attrs) {
            var raw = element[0];
            console.log(element[0]);
            element.bind('scroll', function () {
                console.log('inside scroll');
            });
        }
    };
});

Here I attached my fiddle link.Please someone help me to fix this issue.

There is no HTML event fired when you scroll through a select box as it is rendered by your operating system and not the browser.

If you really need to catch this behavior, you should use a HTML select element, such as the popular select2 or selectize libraries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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