Event not firing/being caught

I have a class DiscordClient that I would like to emit events because I want other classes to be able to respond to them. But, either the event is not firing or it is not being caught.
The results that I am getting are that console.log cal…

Datetime Function

For a school project, I am writing a function that takes in a datetime variable. If the datetime_variable.day_name() != ‘Friday’ I need to subtract a day until the day_name is equal to Friday. I wrote what I thought was a recursive functio…

Align option right [duplicate]

I intend to align the option to the right. I’m doing it this way, but it’s not the correct one:

.form-control2 {
display: block;
height: 25px;
width: 100%;
border: none;
border-radius: 0 !important;
font-size: 18px;
font-…

Is there a git max tag name length?

I’m curious if there are any limits on the length of a git tag name. If not within the official git documentation, then what about some of the more popular platforms such as github, bitbucket, gitlab, etc.?
The docs I’ve seen do not list a…

synchronise scrolling between 2 divs in native javascript (2020)

I’m trying to make a fake/duplicated scroll element that is synced with the actual x-scroll of a div in native javaScript. The use case for me is on a long table to have the x-scroll be present on screen when you’re not at the bottom of the table.

This solves the situation of having a really wide table with a min-width that exceeds the current page/view-port width, causing the table to side/x-scroll. However, if the table is very long, the scroll can only be set on top or bottom of the table. That means if people are mid-way down the table and want to scroll across to see all of the columns, they would have difficulty in doing it there.

See image:

enter image description here

Yep, it’s been done to death IN JQUERY. According to my research, no one on SO knows or has been interested in doing this in native javaScript (esp 2020). My version for reference is also in jQuery, it needs to be converted.

  $dupScroll.scroll(function () {
    if (scrolling) {
      scrolling = false;
      return true;
    }
    scrolling = true;
    $tableParent.scrollLeft($dupScroll.scrollLeft());
  });
  $tableParent.scroll(function () {
    if (scrolling) {
      scrolling = false;
      return true;
    }
    scrolling = true;
    $dupScroll.scrollLeft($tableParent.scrollLeft());
  });

All the jQuery solutions:

  1. How to Scroll two div’s at the same time?
  2. synchronizing scrolling between 2 divs
  3. synchronizing scrolling between 2 divs with different text size
  4. How to sync the scroll of two divs by ID
  5. synchronise scrolling of two divs

Help is appreciated and will be useful for all the people needing to do the same post-jQuery. I’m currently working on this myself but running into snags here and there, the 1st being attaching a scroll event onto an element. If I make something that works, I’ll post it here. Thanks.