Skip to content

Commit c602878

Browse files
committed
updated README
1 parent a9d4ab4 commit c602878

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,32 @@ This will take the parents height, the elements own height and calculate the dis
2525
Options
2626
-------
2727

28-
You can pass one parameter to the plugin, which is the css attribute that the value should be set on. The default is 'margin-top', but you can pass any attribute you would like. Most probably 'padding-top' or 'top'.
28+
You can pass 1 parameter and an options hash to the plugin.
29+
30+
- `onAttribute` - the css attribute that the value should be set on (default: `'margin-top'`)
31+
- `verticalOffset` - the number of pixels to offset the vertical alignment by, ie. `10`, `"50px"`, `-100` (default: `0`)
32+
- `parentSelector` - a selector representing the parent to vertically center this element within, ie. `".container"` (default: the element's immediate parent)
33+
34+
Examples:
2935

3036
<script>
3137
$(document).ready(function() {
3238
$('#element-to-be-centered').flexVerticalCenter('padding-top');
3339
});
3440
</script>
3541

42+
<script>
43+
$(document).ready(function() {
44+
$('#element-to-be-centered').flexVerticalCenter('margin-top', { verticalOffset: 50 });
45+
});
46+
</script>
47+
48+
<script>
49+
$(document).ready(function() {
50+
$('#element-to-be-centered').flexVerticalCenter('padding-top', { verticalOffset: 50, parentSelector: '.parent' });
51+
});
52+
</script>
53+
3654

3755
Non-jQuery version
3856
------------------

0 commit comments

Comments
 (0)