Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.
```