Home > Web Front-end > JS Tutorial > 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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 15:25:37
Original
1605 people have browsed it

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();
});

Copy after login

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.

Related labels:
Statement of this Website
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
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template