文本区域中的滚动条光标模式(适用于Google Chrome)

时间:2015-09-14 08:05:37

标签: javascript jquery css

我已经实现了文本区域,因此文本区域有两种模式。只读模式和编辑模式。在只读模式下,我已将光标模式设置为只读 例如: - (CSS代码)cursor: not-allowed;但滚动条光标模式也给出了只读符号。我附上了屏幕截图供您参考。有没有办法只为滚动条更改光标模式?我想仅将滚动条光标模式更改为默认模式,例如: - cursor: default ; text-area-cursor-mode text-area-cursor-mode in scroll-bar

2 个答案:

答案 0 :(得分:3)

  

我们必须添加两个分区标签,一个用于整个div,另一个用于   像这样的文本区有两个类

<div class="form-control readonly-form-text">
  <div class="readonly-form-text-content">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore 
  </div>
</div>

我们必须为每个CSS类提供唯一的属性

.form-control readonly-form-text {
   overflow: auto; 
   cursor: default !important; 
}

.readonly-form-text-content {
   cursor:not-allowed;
}

这是获得想法的屏幕截图

Main div tag Special div tag to add text

答案 1 :(得分:0)

<textarea>中,您无法处理滚动条光标,当您已经更改光标时(例如:-cursor:not-allowed)。

Google chrome has same open issue.