Skip to content

Instantly share code, notes, and snippets.

@panda01
Last active May 17, 2021 19:51
Show Gist options
  • Save panda01/444486e9aa79a6d07d6867f56fbf6e2e to your computer and use it in GitHub Desktop.
Save panda01/444486e9aa79a6d07d6867f56fbf6e2e to your computer and use it in GitHub Desktop.
// For those really really annoying manual reviews <.<
$(".slider.slider-horizontal").each(function() {
const sliderBoundingRect = this.getBoundingClientRect();
const rightEdgeOfSlider = (sliderBoundingRect.left + sliderBoundingRect.width);
const mouseDownEvt = new MouseEvent("mousedown", {clientY: sliderBoundingRect.top, clientX: rightEdgeOfSlider});
this.dispatchEvent(mouseDownEvt);
const mouseUpEvt = new MouseEvent("mouseup", {clientY: sliderBoundingRect.top, clientX: rightEdgeOfSlider});
document.dispatchEvent(mouseUpEvt);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment