File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ This class allows the INPUT element types RADIO and CHECKBOX to behave more natu
5
5
6
6
## Dependence
7
7
8
- - none
8
+ - ** none**
9
9
---
10
10
11
11
Install
@@ -19,6 +19,25 @@ Download the package with JavaScript file manually:
19
19
20
20
Examples
21
21
--------
22
+ ** simple use**
23
+
22
24
``` javascript
23
- new pseudoNatural (document .getElementsByTagName (" input" ));
25
+ // declare the elements that you want to transform
26
+ var elements= document .getElementsByTagName (" input" );
27
+
28
+ // create object from class and forward elements
29
+ new pseudoNatural (elements);
30
+ ```
31
+
32
+ ** subsequent transformation of new elements**
33
+ ``` javascript
34
+ // declare the elements that you want to transform
35
+ var elements= document .getElementsByTagName (" input" );
36
+
37
+ // create object from class and forward elements
38
+ var pointer= new pseudoNatural (elements);
39
+
40
+ // add new element to class
41
+ var element= document .getElementById (" someID" )
42
+ pointer .addElement (element);
24
43
```
Original file line number Diff line number Diff line change @@ -39,11 +39,11 @@ pseudoNatural.prototype={
39
39
40
40
if ( this . elem != undefined ) {
41
41
for ( var i = 0 ; i < this . elem . length ; i ++ ) {
42
- this . setUpElement ( this . elem [ i ] ) ;
42
+ this . addElement ( this . elem [ i ] ) ;
43
43
}
44
44
}
45
45
} ,
46
- setUpElement :function ( element ) {
46
+ addElement :function ( element ) {
47
47
this . observer . observe ( element , { attributes : true } ) ;
48
48
this . observer . elements . push ( element ) ;
49
49
if ( element . type == "checkbox" ) {
You can’t perform that action at this time.
0 commit comments