Rahul Bisht Rahul Bisht - 2 months ago 8
Javascript Question

Unable to bind scroll event in tinymce

The solution below works quite well for a bunch of events, but when I am trying to bind

scroll
, it is not working. If I bind
scroll
event like this and scroll the browser's window (not editors) then it gets fired, but if I scroll inside editor it doesn't:

setup: function(ed){
ed.on('scroll', function() {
console.log('Editor window scrolled!');
});
}


binding event in tinymce

Answer

Try the following:

setup: function(ed){
    ed.on('init', function() { 
         $(ed.getWin()).bind('scroll', function(e){
            console.log('Editor window scrolled!');
        });
    });

Its work for me :-)