Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taji-taji/click-edit
to make it editable by clicking
https://github.com/taji-taji/click-edit
Last synced: 5 days ago
JSON representation
to make it editable by clicking
- Host: GitHub
- URL: https://github.com/taji-taji/click-edit
- Owner: taji-taji
- Created: 2014-05-24T15:13:31.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-17T23:37:58.000Z (over 10 years ago)
- Last Synced: 2023-04-04T02:41:45.226Z (over 1 year ago)
- Language: JavaScript
- Size: 230 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jQuery Click Edit
to make it editable by clicking
## Usage
```html
edit target
A
B
C
1
2
3
4
5
6
```
```js
$('p').ce();
$('td').ce({
width: 'fit',
height: 'fit'
});
```## Options
```js
afterChangeVal : function() {}, // A function run after change target text.
afterShow : function() {}, // A function run after show edit field.
beforeChangeVal : function() {}, // A function run before change target text.
cancelButton : false, // Create a button to cancel edit
cancelButtonClass : null, // Add custom class to cancel button
cancelText : 'Cancel', // Text for cancel button
editButton : false, // Create a button to start edit
editButtonClass : null, // Add custom class to edit button
editText : 'Edit', // Text for edit button
finishButton : false, // Create a button to finish edit
finishButtonClass : null, // Add custom class to finish button
finishText : 'OK', // Text for finish button
height : 'fit', // 'auto' or 'fit' or a numerical value.
type : 'input', // Edit field type. 'input' or 'textarea'
width : 100 // 'fit' or a numerical value. 'fit' -> fit the target width
```## Functions
```js
$('p').ce('cancel'); // Cancel edit
$('p').ce('destroy'); // Destroy the bind and give you the raw element.
$('p').ce('show'); // Show edit fields.
```