How to make overlay recognized as linked class
See original GitHub issueDemo: https://chattanoogahistory.com/HTML5-boilerplate/clicktest.php
Using OpenSeadragonHTMLelements.js to position SVG(s) over specific locations in canvas. I use classes to link/open other .dzi’s This works well for other elements, such as the button labeled ‘INDEX’. However, the red SVG has the same class assigned, but does not react to a click. I suspect a JavaScript issue, but cannot figure it out.
Any assistance would be greatly appreciated.
Code that links and opens other dzi:
// 16
$(document).on('click', '.loc16', function() {
viewer.open([{
tileSource: loc16
}]);
$("#div1").text("Plate 16");
setTimeout(function() {
viewer.viewport.fitBounds(box1);
}, 400);
});
Overlay that is assigned the same class, but not clickable:
var hEl = viewer.HTMLelements()
var img = document.createElement('img')
img.src = 'https://chattanoogahistory.com/svg/16.svg';
img.style.backgroundColor = 'rgba(255,0,0,0.2)'
img.style.borderRadius = '50%'
img.className = "loc16";
hEl.addElement({
id: "loc16",
element: img,
x: 4600,
y: 3300,
width: 300,
height: 300
})
Issue Analytics
- State:
- Created 9 months ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
CSS Overlay Techniques - Codrops
First, you need to make sure that the overlay is positioned absolutely with respect to the body . So, if the overlay is...
Read more >How to overlay one div over another div - html - Stack Overflow
To do this, we'll wrap the .navi and #infoi elements in a new element <div class="wrapper"> so we can create a new position...
Read more >How to overlay one div over another div using CSS
It looks sophisticated and is simple to design. Overlays can create using two simple CSS properties: z-index. position.
Read more >Create and Manage Overlays - Sailthru Documentation
When you click New Overlay, the Choose a basic template screen opens: Click an image to select either bar or modal for the...
Read more >How To Create a Full screen Overlay Navigation - W3Schools
Example ; /* Height & width depends on how you want to reveal the overlay (see JS below) */ height · 100% ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pearcetm Aha! Anyway, I updated the docs so that we have it documented. Thank you.
Instead of using jQuery delegated events, try using a
MouseTracker
so your events aren’t eaten by the viewer’s event handling:This should at least get you to the point where you are receiving the events. It will require a little refactoring of where you define the handler(s) but hopefully that won’t be too hard.