[JS]ポップアップウィンドウの作成
42534 ワード
💡 Java Scriptを使用したポップアップウィンドウの作成
多くのWebサイトで見られるシェイプのポップアップウィンドウを作成します!
🔴 メインHTML、CSS
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>메인페이지</title>
<style type="text/css">
body {
background:beige;
}
</style>
</head>
<body>
<button type="button">
팝업 1
</button>
<button type="button">
팝업 2
</button>
</body>
</html>
🟠 ポップアップ1 HTML、CSS
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>팝업 1</title>
<style type="text/css">
body {
background: #ff66ff;
font-size: 24px;
color: #fff;
}
</style>
</head>
<body>
첫 번째 팝업입니다.
<a href>[닫기]</a>
</body>
</html>
🟡 ポップアップ2 HTML、CSS
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>팝업 2</title>
<style type="text/css">
body {
background: rgb(56, 255, 132);
font-size: 24px;
color: #fff;
}
</style>
</head>
<body>
두 번째 팝업입니다.
<a href>[닫기]</a>
</body>
</html>
🟢 JSの設定
(スクリプト位置を
Reference
この問題について([JS]ポップアップウィンドウの作成), 我々は、より多くの情報をここで見つけました https://velog.io/@dpdnjs402/ttcyab8iテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol