I'm trying to make a simple single page that displays panorama image based on <select>.
My code:
pannellum.viewer('panorama', {
"type": "equirectangular",
"panorama": "https://pannellum.org/images/alma.jpg",
"autoLoad": true,
"autoRotate": -2,
"title": "LEVEL 1"
});
<script src="https://cdn.pannellum.org/2.4/pannellum.js"></script>
<div style="display:inline; color: red">Choose Location:</div>
<div style="align: right;display:inline;">
<select>
<option value="Level 1">Level 1</option>
<option value="Level 2">Level 2</option>
<option value="Le4el 3">Level 3</option>
<option value="Level 4">Level 4</option>
</select>
</div>
<div id="panorama"></div>
For example: If I choose for Level 1 from <select> , the image link in the <script> shall change. Any solutions that I can do that? I'm still a learner in javascript.
You should define a JavaScript function and attach select tag with event onclick, so that whenever it's value is changed, that javascript function will be called and changed value will be passed.
And update image link in panorama attribute whenever function is called.