mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Merge pull request #668 from ricochet2200/hidden-overlay
Hidden overlay
This commit is contained in:
commit
5d61bcedd3
@ -282,7 +282,10 @@
|
|||||||
style.left = position.x + "px";
|
style.left = position.x + "px";
|
||||||
style.top = position.y + "px";
|
style.top = position.y + "px";
|
||||||
style.position = "absolute";
|
style.position = "absolute";
|
||||||
style.display = 'block';
|
|
||||||
|
if (style.display != 'none') {
|
||||||
|
style.display = 'block';
|
||||||
|
}
|
||||||
|
|
||||||
if ( scales ) {
|
if ( scales ) {
|
||||||
style.width = size.x + "px";
|
style.width = size.x + "px";
|
||||||
|
41
test/demo/overlay.html
Normal file
41
test/demo/overlay.html
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<html>
|
||||||
|
<title>OpenSeadragon Overlay Demo</title>
|
||||||
|
<script type="text/javascript" src='../../build/openseadragon/openseadragon.js'></script>
|
||||||
|
<script type="text/javascript" src='../lib/jquery-1.9.1.min.js'></script>
|
||||||
|
<style type="text/css">
|
||||||
|
|
||||||
|
.openseadragon1 {
|
||||||
|
width: 800px;
|
||||||
|
height: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="contentDiv" class="openseadragon1"></div>
|
||||||
|
<div id="annotation-div">
|
||||||
|
<input type="button" value="Hide Overlay" id="hideOverlay">
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var viewer = OpenSeadragon({
|
||||||
|
id: "contentDiv",
|
||||||
|
prefixUrl: "../../build/openseadragon/images/",
|
||||||
|
tileSources: "../data/testpattern.dzi",
|
||||||
|
});
|
||||||
|
|
||||||
|
viewer.addHandler("open", function(event) {
|
||||||
|
var elt = document.createElement("div");
|
||||||
|
elt.style.background = "green";
|
||||||
|
elt.id = "runtime-overlay";
|
||||||
|
elt.style.border = "1px solid red";
|
||||||
|
viewer.addOverlay( elt, new OpenSeadragon.Rect(0.2, 0.2, 0.75, 0.75) );
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#hideOverlay").click(function(){
|
||||||
|
$("#runtime-overlay").toggle();
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user