Skip to content

Commit 33b5459

Browse files
committed
[readme] - update docs to use instance
1 parent 5d1d48e commit 33b5459

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ From this point on whenever 'Macy' is specified it is referencing the variable y
8888
When called this recalculates the entire layout, this becomes useful if you just used ajax to pull in more content:
8989

9090
```javascript
91-
Macy.recalculate();
91+
macy_instance.recalculate();
9292
```
9393

9494
##### **onImageLoad**
@@ -98,30 +98,30 @@ Macy.recalculate();
9898
onImageLoad is a method used to do something each time and image loads or after all images have been loaded. This helps when using Ajax to make sure the layout is worked out correctly when images are loading. Using this in conjunction with the recalculate function makes your layouts look great no matter how long it takes to load in your images:
9999

100100
```javascript
101-
Macy.onImageLoad(function () {
101+
macy_instance.onImageLoad(function () {
102102
console.log('Every time an image loads I get fired');
103-
Macy.recalculate();
103+
macy_instance.recalculate();
104104
}, function () {
105105
console.log('I only get called when all images are loaded');
106-
Macy.recalculate();
106+
macy_instance.recalculate();
107107
});
108108
```
109109

110110
If you only require it to run once all the images have loaded you can acheive this by passing null as the first parameter:
111111

112112
```javascript
113-
Macy.onImageLoad(null, function () {
113+
macy_instance.onImageLoad(null, function () {
114114
console.log('I only get called when all images are loaded');
115-
Macy.recalculate();
115+
macy_instance.recalculate();
116116
});
117117
```
118118

119119
If you only require the during function to run then only pass it one function:
120120

121121
```javascript
122-
Macy.onImageLoad(function () {
122+
macy_instance.onImageLoad(function () {
123123
console.log('Every time an image loads I get fired');
124-
Macy.recalculate();
124+
macy_instance.recalculate();
125125
});
126126
```
127127

@@ -131,7 +131,7 @@ Macy.onImageLoad(function () {
131131
Remove does exactly what it says on the tin, it removes all styling and event listeners that Macy added to the DOM:
132132

133133
```javascript
134-
Macy.remove();
134+
macy_instance.remove();
135135
```
136136

137137
##### **reInit**
@@ -140,7 +140,7 @@ Macy.remove();
140140
Reinitialises the current macy instance;
141141

142142
```javascript
143-
Macy.reInit();
143+
macy_instance.reInit();
144144
```
145145

146146
---

0 commit comments

Comments
 (0)