HTTP URLs support fragment identifiers that link to a specific part of a web page. A fragment identifier is placed at the end of the URL and is separated by the "#" character. You can use this fragment identifier to specify a particular pano to load.
When loading a new scene, use the following javascript to set the fragment identifier.
|
Quellcode
|
1
2
|
document.location.hash = "#" + pano;
krpano.call("loadscene(" + pano + ");");
|
When a page first loads, use the following javascript to load the URL-specified scene.
|
Quellcode
|
1
2
3
4
|
if(document.location.hash){
// hash begins with '#', so remove first char to access pano name
krpano.call("loadscene(" + document.location.hash.substr(1) + ");");
}
|