We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05aaeae commit 232e930Copy full SHA for 232e930
index.html
@@ -163,6 +163,10 @@
163
});
164
165
function onButterflyClick(event) {
166
+ // Prevent default behavior and stop propagation
167
+ event.preventDefault();
168
+ event.stopPropagation();
169
+
170
// Get the clicked element
171
const butterfly = event.currentTarget;
172
@@ -173,6 +177,12 @@
173
177
const screenX = window.screenX + rect.left;
174
178
const screenY = window.screenY + rect.top;
175
179
180
+ // Clean up hover-img preview before removing the butterfly
181
+ const hoverImg = document.getElementById('hover-img');
182
+ if (hoverImg) {
183
+ hoverImg.remove();
184
+ }
185
176
186
// Remove the butterfly from the DOM
187
butterfly.remove();
188
0 commit comments