需引入文件
<script src="js/jquery.min.js" type="text/javascript"></script> <script src="js/jquery.scrollTo.js" type="text/javascript"></script> <script src="js/jquery.ascensor.js" type="text/javascript"></script> <script src="js/myscript.js" type="text/javascript"></script>
html内容
<div id="house"> <div> <!-- Etage1--> <div id="ContentName"> </div> <!-- Content of the floor 1--> </div> <div> <!-- Etage2--> <div id="ContentName"> </div> <!-- Content of the floor 2--> </div> <div> <!-- Etage3--> <div id="ContentName"> </div> <!-- Content of the floor 3--> </div> <div> <!-- Etage4--> <div id="ContentName"> </div> <!-- Content of the floor 4--> </div> <div> <!-- Etage5--> <div id="ContentName"> </div> <!-- Content of the floor 5--> </div> </div>
调用方式
$('#house').ascensor(); $('#house').ascensor({ AscensorName: 'house', //you can choose the name that will define id and class (default:'maison') WindowsFocus: true, //if you start on the first content(default:true) WindowsOn: '0', //if you can to start to the 0,1,2,3 etc.. content Direction: 'y', //What will be the direction of the ascensor NavigationDirection: 'xy', //what will be his navigation direction(par défaut:'xy') });