Skip to content

Commit 303bf9e

Browse files
save file
1 parent bb9a00a commit 303bf9e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

merry-christmas/2025/merry-christmas-2025.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,15 @@ <h3>
297297
var img = new Image(50,50);
298298
img.src='https://javascript-2020.github.io/storage/images/snowflake1.png';
299299
img.style.cssText = 'position:absolute;bottom:50px;right:50px;z-index:99';
300-
img.onclick = click;
300+
img.tabIndex=0;
301+
img.onclick = e=>e.stopPropagation();
302+
img.onkeydown = e=>e.key=='m' && show();
303+
301304
document.body.append(img);
302305

303306

304-
function click(e){
307+
function show(){
305308

306-
e.stopPropagation();
307309
window.open('https://javascript-2020.github.io/images/image-1.jpg');
308310

309311
}//click

0 commit comments

Comments
 (0)