Home  >  Article  >  Web Front-end  >  Solution to the problem that the Textarea scroll bar cannot be dragged in JavaScript_javascript skills

Solution to the problem that the Textarea scroll bar cannot be dragged in JavaScript_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:25:371548browse

This article analyzes the solution to the problem that the Textarea scroll bar cannot be dragged in JavaScript. Share it with everyone for your reference, the details are as follows:

In IE, have you ever encountered that the scroll bar of Textarea cannot be dragged, but the content can be scrolled by clicking the up and down buttons?

The reason for this problem is probably that the onfocus event is bound to the Textarea, but based on certain conditions, its focus is removed (ie blur()), which results in the scroll bar being unable to be dragged.

A typical example is:

me.$input.on("focus",function(){
  if ($isIE && me.enabled == false)
    me.$input.blur();
});

When the input control $input (DOM element I·textarea) binds the focus event and then sets it to unavailable (!enabled), it loses focus, causing the scroll bar to not be dragged.

I hope this article will be helpful to everyone in JavaScript programming.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn