Building your multi-screen webpage is as simple as dividing up the <body> of your HTML into <div> elements, giving them all the ms-container class (the plugin needs at least two to run), and building each screen inside. Give the element you want as your default screen the class ms-default. If no default is specified, the top ms-container will be used, and if more than one default is found the top ms-default will be used.
To facilitate navigation between screens, each one requires a unique id attribute.
<body> <div id="screen1" class="ms-container ms-default"> <!-- screen1 content --> </div> <div id="screen2" class="ms-container"> <!-- screen2 content --> </div> </body>
Back to introduction or move on to Building screen navigation.
Multi-Screen.js makes it easy to change the defaults for the animations, their times, the starting distance between the entering and exiting screens, and whether the animations should occur synchronously or asynchronously. Each function below returns a boolean (true if default was succesfully changed or false if not). You may also pass an options object into the init function (see documentation).
/** * Sets the default animation * `command` must be a valid animation command * `type` must be 'enter' or 'exit' (OPTIONAL) */ MultiScreen.set_default_animation(String command, String type); /** * Sets the default animation time in milliseconds * `time` must be a valid integer greater than 0 * `type` must be 'enter' or 'exit' or 'scroll' (OPTIONAL) */ MultiScreen.set_default_time(Number time, String type); /** * Sets the default starting distance between the edge of the entering and exiting screens in pixels * `distance` must be a valid integer (can be negative) * `dimension` must be 'vertical' or 'horizontal' (OPTIONAL) */ MultiScreen.set_default_distance(Number distance, String dimension); /** * Sets the default delay between the enter and exit animations * `delay` must be a boolean */ MultiScreen.set_default_delay(Boolean delay); /** * Sets the defaults by property * `options` must be an object containing a value for each property to set (see documentation) */ MultiScreen.set_defaults(Object options);
Back to building navigation or move on to Installation.
<head> <title>My Multi-Screen Page</title> <link href="multi-screen-css.css" type="text/css" rel="stylesheet"/> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script> <script type="text/javascript" src="multi-screen.js"></script> <script type="text/javascript">$(document).ready(function() { MultiScreen.init(); });</script> </head>
Back to setting defaults or back to the Introduction.