Right now the overlay is made draggable with makeDraggable(), but if you want it fixed (e.g. always at the top of the screen or directly above .blackjack-wrap), we can strip out the dragging logic and position it with CSS.
Option 1: Fixed at the top of the screen
Replace your addStyles() with this version (and remove makeDraggable(overlay) call in createOverlay):
Fixing Blackjack Overlay Position
Fixing Blackjack Overlay Position
Right now the overlay is made draggable with
makeDraggable(),but if you want it fixed (e.g. always at the top of the screen or directly above
.blackjack-wrap), we can strip out the dragging logic and position it with CSS.Option 1: Fixed at the top of the screen
Replace your
addStyles()with this version (and removemakeDraggable(overlay)call increateOverlay):And in
createOverlay()remove this line:makeDraggable(overlay);This will pin it top-center.
Option 2: Inline just above <div class="blackjack-wrap">
In
createOverlay(), instead of appending todocument.body,insert before
.blackjack-wrap:And update
#bj-helper-overlaystyle to beposition: relative;with
margin-bottom: 8px;so it flows naturally: