Method: center

From Turn.js Documentation
Revision as of 09:07, 6 July 2012 by Emmanuel (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Centers the flipbook depending on how many pages are visible. The center method changes the CSS margin-left property of #flipbook as way to center the flipbook. Therefore, if you need to change the margin-left of the flipbook, it's recommend to insert the flipbook in a container to use its the margin properties.

If the flipbook has the option autoCenter set to true, it might not be necessary to use this method.

This method does not have parameters.



Adding a CSS transition when centering:

	transition:margin-left 1s;
	-webkit-transition:margin-left 1s;
	-moz-transition:margin-left 1s;
	-o-transition:margin-left 1s;
	-ms-transition:margin-left 1s;
	transition:margin-left 1s;

Main Page > API > Turn Methods > Method: center