Make the panorama automatically rotate once loaded using the autoRotate
parameter. The parameter’s value should be a number, with the value specifying the rotation speed in degrees per second; positive is counter-clockwise, and negative is clockwise. The autoRotateInactivityDelay
parameter can also be specified to have the panorama begin rotating again after there is no user interaction for the specified number of milliseconds.
<iframe width="600" height="400" allowfullscreen style="border-style:none;" src="https://cdn.pannellum.org/2.5/pannellum.htm#panorama=https://pannellum.org/images/jfk.jpg&autoRotate=-2"></iframe>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Auto rotate</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pannellum@2.5.6/build/pannellum.css"/>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/pannellum@2.5.6/build/pannellum.js"></script>
<style>
#panorama {
width: 600px;
height: 400px;
}
</style>
</head>
<body>
<div id="panorama"></div>
<script>
pannellum.viewer('panorama', {
"type": "equirectangular",
"panorama": "https://pannellum.org/images/jfk.jpg",
"autoRotate": -2
});
</script>
</body>
</html>
Pannellum is developed on GitHub by Matthew Petroff.
CDN via KeyCDN.