Skip to content

Commit 62b9782

Browse files
author
Lucas Klaassen
committed
Update resizer function to fire on window load
1 parent 1128be1 commit 62b9782

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jquery.flexverticalcenter.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@
3333
);
3434
};
3535

36-
// Call once to set.
37-
resizer();
38-
3936
// Call on resize. Opera debounces their resize by default.
4037
$(window).resize(function () {
4138
clearTimeout(debounce);
4239
debounce = setTimeout(resizer, settings.debounceTimeout);
4340
});
4441

42+
// Call once to set after window loads.
43+
$(window).load(function () {
44+
resizer();
45+
});
46+
4547
// Apply a load event to images within the element so it fires again after an image is loaded
4648
$this.find('img').load(resizer);
4749

0 commit comments

Comments
 (0)