https://github.com/youngwind/jquery.cursor
灵活运用光标的jquery插件
https://github.com/youngwind/jquery.cursor
Last synced: 8 months ago
JSON representation
灵活运用光标的jquery插件
- Host: GitHub
- URL: https://github.com/youngwind/jquery.cursor
- Owner: youngwind
- Created: 2016-03-05T13:49:46.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-05T18:00:49.000Z (over 10 years ago)
- Last Synced: 2025-03-11T21:03:41.919Z (over 1 year ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 项目说明
此插件基于jquery,主要用途
1. 操作光标在文本中的位置(textarea和input)
2. 在制定位置插入文字,选中制定的文字片段

# 使用方法
## 1. 安装
```
bower install jquery --save
bower install jquery-cursor --save
```
## 2. 引入
```
<script>
<script src="jquery-cursor.js"><script>
```
## 3. 使用
### 3.1 基本用法
```
$('#textAreaId').cursor({
"text":"这是插入的一些文字,哪些位置被选中由下面两个参数决定",
"beginPos":2, // 开头从0开始计数
"endPos":5 // 如果省略,则从beginPos一直选中到text的结尾
);
```
//todo
1. 添加IE兼容性
2. 添加tab切换在多个位置跳转选中