Skip to content

Commit 171bc58

Browse files
author
Damien Bezborodov
committed
Update 1.1 readme.
1 parent ae6ae95 commit 171bc58

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# jquery.initialize
22

3-
Version: 1.0.0, Last updated: 12/14/2016
3+
Version: 1.1.0, Last updated: 2017-02-06
44

55
jquery.initialize plugin is created to help maintaining dynamically created elementes on page.
66

@@ -20,21 +20,13 @@ TODO: make it `bower` and `npm` compatible, add advanced performance test.
2020

2121
**Initialize has exactly the same syntax as with the .each function**
2222

23-
$(".some-element").initialize( function(){
23+
$.initialize(".some-element", function() {
2424
$(this).css("color", "blue");
2525
});
2626

2727
But now if new element matching .some-element selector will appear on page, it will be instantly initialized. The way new item is added is not important, you dont need to care about any callbacks etc.
2828

29-
$("<div/>").addClass('some-element').appendTo("body"); //new element will have blue color!
30-
31-
32-
Note that plugin needs to know the selector of items you want to initialize. Thats why you need to **call initialize right after you've created jQuery element from selector.**
33-
34-
$(".some-element").initialize(myFunc); //will work
35-
$(".some-element").children().initialize(myFunc); //will NOT work
36-
37-
29+
$("<div/>").addClass("some-element").appendTo("body"); //new element will have blue color!
3830

3931
**Support**
4032

@@ -48,4 +40,5 @@ Note: To make it work on IE9 and IE10 you'll need to add MutationObserver polyfi
4840
# Contributors
4941
- Adam Pietrasiak
5042
- Damien Bezborodov
51-
- Ninos Ego
43+
- Ninos Ego
44+
- Michael Hulse

0 commit comments

Comments
 (0)