diff --git a/src/overlay.js b/src/overlay.js index 61f5fa88..36ea93a1 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -135,8 +135,12 @@ if (this.element.id) { this.elementWrapper.id = "overlay-wrapper-" + this.element.id; } else { - this.elementWrapper.id = "overlay-wrapper"; + this.elementWrapper.id = "overlay-wrapper-" + crypto.randomUUID(); // Ensure unique ID } + + // Always add a class for easier selection + this.elementWrapper.classList.add("openseadragon-overlay-wrapper"); + this.style = this.elementWrapper.style; this._init(options);