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
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ bower install macy
16
16
17
17
## Usage
18
18
```javascript
19
-
varmacy_instance=Macy({
19
+
varmacyInstance=Macy({
20
20
// See below for all available options.
21
21
});
22
22
```
@@ -104,7 +104,7 @@ This would change the xMargin to 20px when screens are smaller than 760, but the
104
104
105
105
## Methods
106
106
107
-
#####**Macy**
107
+
#### **Macy**
108
108
*Parameters: `{Object} args - required`*
109
109
110
110
This is the initializing function. The function takes an object of properties listed above. The only required property is container which would be the *selector* for the element that contains all the elements you want to be layed out:
@@ -127,61 +127,61 @@ var macy = Macy({
127
127
128
128
From this point on whenever 'Macy' is specified it is referencing the variable you assign macy to when making the initial call.
129
129
130
-
#####**recalculate**
130
+
#### **recalculate**
131
131
*Parameters: `{Boolean} refresh - can be null` & `{Boolean} loaded -can be null` *
132
132
133
133
When called this recalculates the entire layout, this becomes useful if you just used ajax to pull in more content:
134
134
135
135
```javascript
136
-
macy_instance.recalculate();
136
+
macyInstance.recalculate();
137
137
```
138
138
139
-
#####**runOnImageLoad**
139
+
#### **runOnImageLoad**
140
140
141
141
*Parameters: `{Function} - Function to run on image load` & `{Boolean} If true it will run everytime an image loadsl`*
142
142
143
143
runOnImageLoad 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:
144
144
145
145
```javascript
146
-
macy_instance.runOnImageLoad(function () {
147
-
macy_instance.recalculate(true);
146
+
macyInstance.runOnImageLoad(function () {
147
+
macyInstance.recalculate(true);
148
148
}, true);
149
149
```
150
150
151
151
If you only require it to run once all the images have loaded you can acheive this by passing null as the first parameter:
152
152
153
153
```javascript
154
-
macy_instance.runOnImageLoad(function () {
154
+
macyInstance.runOnImageLoad(function () {
155
155
console.log('I only get called when all images are loaded');
156
-
macy_instance.recalculate(true, true);
156
+
macyInstance.recalculate(true, true);
157
157
});
158
158
```
159
159
160
160
If you only require the during function to run then only pass it one function:
161
161
162
162
```javascript
163
-
macy_instance.runOnImageLoad(function () {
163
+
macyInstance.runOnImageLoad(function () {
164
164
console.log('Every time an image loads I get fired');
165
-
macy_instance.recalculate(true);
165
+
macyInstance.recalculate(true);
166
166
}, true);
167
167
```
168
168
169
-
#####**remove**
169
+
#### **remove**
170
170
*Parameters: `None`*
171
171
172
172
Remove does exactly what it says on the tin, it removes all styling and event listeners that Macy added to the DOM:
0 commit comments