Having difficulty attaching the scroll event in tinymce

Although the solution provided below works well for a variety of events, I have encountered an issue when attempting to bind the scroll event. When I bind the scroll event as shown and scroll in the browser's window (rather than the editor), it triggers properly. However, scrolling inside the editor does not trigger the event:

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

tinymce event binding demonstration

Answer №1

Give this a shot:

prepare: function(editor){
    editor.on('initialize', function() { 
         $(editor.getWindow()).bind('scroll', function(event){
            console.log('The editor window has been scrolled!');
        });
    });

This solution worked for me!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Place the text (menu) adjacent to the navigation bar

I am currently using bootsrap 4 alpha 6 in combination with midnight.js to alter the color of my navigation menu toggler. I am trying to incorporate a text element (MENU) alongside it, similar to the example shown in the Capture image. For the text toggler ...

The occurrence of an unanticipated character '#' was found

I'm currently facing an issue while using webpack to load dependencies. Whenever I execute the npm run dev command, I encounter the following error: Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js): SyntaxError: ...

Avoid choosing the menuItem when clicking on the icon within the Material UI select component

I am trying to create a dropdown menu that allows users to delete items. However, when I click on the delete icon within a menu item, the entire menu item gets selected automatically. How can I prevent this default behavior? Here is my code: { dropd ...

Turn off the checkboxes

Is there a way to use JQuery and HTML to disable two checkboxes when one checkbox is enabled? I need help implementing this in MVC 4. Morning @Html.CheckBoxFor(x => x.FromDateMorning, new { style = "width:auto;", id = "chkFromDateAM", ...

Exploring Head-Linked/Off-center View in Three.js

I'm attempting to create a permanent head-coupled perspective without relying on the full headtrackr library. My head will remain stationary, but it will not be directly facing the screen. For those interested, I have a small demonstration available ...

Obtain the search query stored in the state using ReactJS

I'm currently exploring ReactJS and attempting to retrieve the value entered in a search input box, then store it in a state. Here is my code snippet: <form className="search-form" onSubmit={this.handleSubmit}> <input type="search" na ...

Arranging an array of objects from the Fetch API into rows and columns in Bootstrap 4 by utilizing a foreach loop to iterate through the array

I am currently retrieving data from an external API, which returns an array of objects. Each object contains details of characters from the Harry Potter movies, and there are a total of 50 objects in the array. I am using a foreach loop to iterate through ...

`Error encountered when attempting to convert date with Angular JS filter`

Utilizing angular js filter in the controller for date formatting. A user selects a date from a uib-datepicker-popup. The goal is to format this date using ISO 8601 (yyyy-mm-dd) date format. Upon logging the user-selected date, the output is as follows: S ...

Tips for extracting URL parameter values in React applications

Here is a component that allows for searching: import { ChangeEvent, useCallback, useState } from 'react'; export function SearchComponent() { const [searchValue, setSearchValue] = useState<string>(''); const updateSearchValu ...

Select more than one class within a div and keep track of how many times they have been clicked using pure JavaScript

This code snippet serves the purpose of tracking the number of clicks on buttons with either the testButton or incButton class, and displaying an overlay after two clicks. However, two main issues have been identified: 1: Difficulty in selecting buttons wi ...

Is there a way in javascript, jquery, and plupload to dynamically pass a parameter to the URL without needing to reload the page or object?

I've recently taken over a project that utilizes plupload. I am encountering an issue where I need to change the URL of the object after it has been loaded. However, I'm unsure if this is possible and what steps I would need to take to achieve th ...

Transmitting an HTML video object (canvas) to Flask through Ajax communication

I've been struggling to retrieve a user image from the camera using Flask. However, I keep getting a base64 encoded image that is not decodable. I've tried various codes from different platforms but haven't been able to achieve the desired r ...

Leverage React.JS to iterate through arrays and objects, rendering data seamlessly - even within nested objects

Development of Category's Filter component Implementing the rendering of data from a nested array using React Js Although I attempted to render it as seen below, it is not displaying anything The main focus is on the rendering part only var selecte ...

Extract the JSESSIONID and generate a new Cookie using AngularJS

Currently, I am utilizing a Web RESTful API from my client within AngularJS. app.controller('LoginController', [ '$http', '$cookies', function($http, $cookies) { this.credentials = {}; this.http = $ ...

Troubleshooting a Node.js and MongoDB issue: Document Property displays as 'Undefined' upon printing

As I delve into learning Node, Express & Mongodb, I find myself at the beginner level. Currently, my focus is on developing a form that includes a text field for users to input data. My primary objective is to validate whether this data already exists in ...

A step-by-step guide on incorporating HTML into a div element with jQuery

<div class="segment"> <div class="segment-inner"> <p>Content Goes Here...</p> </div> </div> <script type="text/javascript"> jQuery(document).ready(function () { jQuery('<i class="fa f ...

react tried to recycle markup error

Working on server-side rendering with React, encountering an error mentioned below. Here is the context: I have 2 React components, each stored in its own separate folder: - react-components - component-1-folder - component-1 - component-2-fo ...

The VueJS Chosen directive fails to refresh when new options are selected

Struggling to populate my jQuery Chosen dropdown field with AJAX data using VueJS. Unfortunately, when trying to update the values, the Chosen dropdown does not reflect the changes. I've experimented with different approaches, including manually trig ...

A challenge ahead: Transitioning from gulpV3 to gulpV4 without a defined plan

I recently had to update an older project from gulp version 3.9.1 to gulp version 4, which meant rewriting my tasks. Following the documentation on transitioning to gulp.series and using named functions, I thought I had everything in place but I'm sti ...

Using Nunjucks to iterate through an array and selectively choose specific items within a for loop

When faced with a large array of items like [5, 21, 83, 74, 12], and my list structure is as follows: { "list:" [ { "title": "Blue" }, { "title": "Green" }, { "title": "Yellow" } ... ] } I am considering using a for loop to select specifi ...