mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-04-06 07:13:31 +03:00
42 lines
1.1 KiB
HTML
42 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>OpenSeadragon Navigator Test</title>
|
|
<script src="build/openseadragon/openseadragon.js"></script>
|
|
<style>
|
|
#viewer {
|
|
width: 800px;
|
|
height: 600px;
|
|
border: 1px solid black;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="viewer"></div>
|
|
<button onclick="showNavigator()">Show Navigator</button>
|
|
<button onclick="hideNavigator()">Hide Navigator</button>
|
|
|
|
<script>
|
|
// Initialize the viewer
|
|
const viewer = OpenSeadragon({
|
|
id: "viewer",
|
|
tileSources:
|
|
"https://openseadragon.github.io/example-images/highsmith/highsmith.dzi",
|
|
showNavigator: true, // Enable the navigator
|
|
});
|
|
|
|
// Functions to test setVisible
|
|
function showNavigator() {
|
|
viewer.navigator.setVisible(true);
|
|
console.log("Navigator set to visible");
|
|
}
|
|
|
|
function hideNavigator() {
|
|
viewer.navigator.setVisible(false);
|
|
console.log("Navigator set to hidden");
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|