Created
September 4, 2013 03:56
-
-
Save codeBelt/6432609 to your computer and use it in GitHub Desktop.
HTML to show event bubbling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<link rel="stylesheet" href="css/style.css" media="screen" type="text/css"/> | |
</head> | |
<body> | |
<div class="wrapper"> | |
<div class="splitPair"> | |
<span class="message message_stage">Stage has received the event</span> | |
<button>clear</button> | |
</div> | |
<div class="container container-alpha"> | |
<div class="container-hd"> | |
<p>Alpha Container</p> | |
</div> | |
<div class="container-bd"> | |
<div class="splitPair"> | |
<span class="message">alpha</span> | |
<input type="checkbox" id="alpha" class="splitPair-input"/> | |
</div> | |
<div class="container container-beta"> | |
<div class="container-hd"> | |
<p>Beta Container</p> | |
</div> | |
<div class="container-bd"> | |
<div class="splitPair"> | |
<span class="message">beta</span> | |
<input type="checkbox" id="beta" class="splitPair-input"/> | |
</div> | |
<div class="container container-gamma"> | |
<div class="container-hd"> | |
<p>Gamma Container</p> | |
</div> | |
<div class="container-bd"> | |
<div class="splitPair"> | |
<span class="message">gamma</span> | |
<input type="checkbox" id="gamma" class="splitPair-input"/> | |
</div> | |
<button class="button_dispatch">Dispatch Event</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, | |
b, u, i, center, | |
dl, dt, dd, ol, ul, li, | |
fieldset, form, label, legend, | |
table, caption, tbody, tfoot, thead, tr, th, td, | |
article, aside, canvas, details, embed, | |
figure, figcaption, footer, header, hgroup, | |
menu, nav, output, ruby, section, summary, | |
time, mark, audio, video { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
font-size: 100%; | |
font: inherit; | |
vertical-align: baseline; | |
} | |
/* HTML5 display-role reset for older browsers */ | |
article, aside, details, figcaption, figure, | |
footer, header, hgroup, menu, nav, section { | |
display: block; | |
} | |
body { | |
line-height: 1; | |
} | |
ol, ul { | |
list-style: none; | |
} | |
blockquote, q { | |
quotes: none; | |
} | |
blockquote:before, blockquote:after, | |
q:before, q:after { | |
content: ''; | |
content: none; | |
} | |
table { | |
border-collapse: collapse; | |
border-spacing: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
html, body { | |
background: #333; | |
height: 100%; | |
font-size: 84%; | |
font-weight: bold; | |
font-family: arial, sans-serif; | |
text-transform: lowercase; | |
} | |
.wrapper { | |
position: absolute; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
margin: auto; | |
width: 350px; | |
height: 400px; | |
padding: 35px 25px; | |
} | |
.container { | |
padding: 10px; | |
background: #eee; | |
height: auto; | |
box-shadow: 0 2px 2px rgba(0, 0, 0, .3); | |
border-radius: 5px; | |
margin: 5px 0; | |
} | |
.container-hd { | |
padding: 2px 0 6px; | |
} | |
.container-hd > p { | |
font-size: 1.1em; | |
margin: 0; | |
} | |
.container-bd { | |
background: white; | |
height: auto; | |
padding: 10px 10px; | |
box-shadow: 0 2px 2px rgba(0, 0, 0, .3); | |
} | |
.splitPair { | |
display: table; | |
width: 100%; | |
margin: 0 0 10px 0; | |
text-align: left; | |
padding: 0 5px; | |
} | |
.splitPair > * { | |
display: table-cell; | |
vertical-align: middle; | |
width: 100%; | |
} | |
.message { | |
font-weight: normal; | |
} | |
.message_stage { | |
color: khaki; | |
} | |
.container-gamma .container-bd { | |
text-align: center; | |
} | |
.button_dispatch { | |
padding: 10px; | |
text-transform: lowercase; | |
font-weight: bold; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment