-
-
Save PadreZippo/4f958abef3adaf128794 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ upload slider.js on your server | |
/ add your urlid in var array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="https://d2f25wgezub9nf.cloudfront.net/api/sketchfab-viewer-1.0.0.js"></script> | |
<script src="slider.js"></script> | |
<div align="center"> | |
<iframe id="api-frame" height="480" width="640"></iframe> | |
</div> | |
<div align="center"> | |
<button onclick="next()">Next model</button> | |
<button onclick="previous()">Previous model</button> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iframe = $( '#api-frame' )[ 0 ]; | |
var version = '1.0.0'; | |
var client = new Sketchfab( version, iframe ); | |
var index = 0; | |
var array = ["urlid1","urlid2","urlid3","urlid4",]; | |
client.init(array[index]); | |
function next() { | |
index++; | |
if(index >= array.length) { | |
index = 0; | |
} | |
client.init(array[index]); | |
} | |
function previous() { | |
index--; | |
if(index < 0 ) { | |
index = array.length-1; | |
} | |
client.init(array[index]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment