You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ From this point on whenever 'Macy' is specified it is referencing the variable y
88
88
When called this recalculates the entire layout, this becomes useful if you just used ajax to pull in more content:
89
89
90
90
```javascript
91
-
Macy.recalculate();
91
+
macy_instance.recalculate();
92
92
```
93
93
94
94
##### **onImageLoad**
@@ -98,30 +98,30 @@ Macy.recalculate();
98
98
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:
99
99
100
100
```javascript
101
-
Macy.onImageLoad(function () {
101
+
macy_instance.onImageLoad(function () {
102
102
console.log('Every time an image loads I get fired');
103
-
Macy.recalculate();
103
+
macy_instance.recalculate();
104
104
}, function () {
105
105
console.log('I only get called when all images are loaded');
106
-
Macy.recalculate();
106
+
macy_instance.recalculate();
107
107
});
108
108
```
109
109
110
110
If you only require it to run once all the images have loaded you can acheive this by passing null as the first parameter:
111
111
112
112
```javascript
113
-
Macy.onImageLoad(null, function () {
113
+
macy_instance.onImageLoad(null, function () {
114
114
console.log('I only get called when all images are loaded');
115
-
Macy.recalculate();
115
+
macy_instance.recalculate();
116
116
});
117
117
```
118
118
119
119
If you only require the during function to run then only pass it one function:
120
120
121
121
```javascript
122
-
Macy.onImageLoad(function () {
122
+
macy_instance.onImageLoad(function () {
123
123
console.log('Every time an image loads I get fired');
0 commit comments