JSFiddle - React, Tailwind, and code Playground
HTML
<meta name="viewport" content="user-scalable=0, initial-scale=1.0, maxiumum-scale=1.0, width=device-width" />
<div class="wrapper">
<h1>How To Win</h1>
<section>
<h2>BE A WINNER!</h2>
<div class="content">
<p>What you want to do is be like Charlie sheen</p>
<p style="color: blue">Whatever Charlie Sheen does DO IT!</p>
<p> after you learn the first rule you can do what ever you want, Remember you have TIGER BLOOD!</p>
</div>
</section>
<section>
<h2>Remember you're a winner!</h2>
<div class="content">
<img src="http://4.bp.blogspot.com/-RIQaSwYls64/TaH-y5tJP7I/AAAAAAAAAOI/TM8DnBXmD8M/s1600/Charlie-Sheen-Winning-Poster.jpg" />
<img src="http://www.financefox.ca/wp-content/uploads/2012/11/I-dont-always-win-but-when-i-do-Im-winning....DUH_.jpg" />
<img src="http://www.youngupstarts.com/wp-content/uploads/2012/12/success_kid.jpg" />
<img src="http://i540.photobucket.com/albums/gg350/phemohilia/Funny/Bi-Winning.jpg" />
</div>
</section>
<section>
<h2>Need help with winning?</h2>
<div class="content">
<p>Check out these people!:</p>
<ul>
<li><a href="http://www.charliesheen.com/"> Winning!</a></li>
<li><a href="http://www.thefreedictionary.com/winning"> Look at it</a></li>
</ul>
<iframe width="560" height="315" src="//www.youtube.com/embed/h5aSa4tmVNM" frameborder="0" allowfullscreen></iframe>
</div>
</section>
<section>
<h2>If anyone asks</h2>
<div class="content">
<img src="http://www.alliednetservices.com/clipart/winning_360.jpg" />
</div>
</section>
<section>
<h2>Winning</h2>
<div class="content">
<iframe width="560" height="315" src="//www.youtube.com/embed/9QS0q3mGPGg"...
CSS
body {
background: #ddd;
font-family: "lucida grande", tahoma, sans-serif;
}
footer {
color: gray;
font-size: 0.8em;
margin: 1em 0;
text-align: center;
font-style: italic;
}
h1 {
font-size: 1.6em;
margin: 1em 0;
}
h2 {
background-position: left center;
background-repeat: no-repeat;
cursor: pointer;
font-size: 1.2em;
margin: 0.5em 0;
padding-left: 20px;
}
h2:hover {
color: #666;
}
h2.open {
background-image: url('http://public.harmonicnw.com/tft_2013-02-20/ddarrow-down.png');
}
h2.closed {
background-image: url('http://public.harmonicnw.com/tft_2013-02-20/ddarrow-right.png');
}
img {
height: auto;
margin-bottom: 1em;
width: 100%;
}
p {
margin: 1em 0;
}
section {
background: #ffeeb2;
border-radius: 5px;
margin: 5px 0;
padding: 5px 3%;
width: 94%;
}
.wrapper {
background: white;
margin: 0 auto;
max-width: 480px;
padding: 10px 3%;
width: 90%;
}
JavaScript
$(document).ready( function() {
$(".wrapper").fitVids();
$("section").each( function(i) {
var content = $(this).children(".content");
var hdr = $(this).children("h2");
hdr.text(i+1 + ". " + hdr.text());
hdr.click( function(e) {
if (content.is(":visible")) {
content.slideUp();
hdr.removeClass("open").addClass("closed");
} else {
$("section").children(".content:visible").slideUp();
$("section").children("h2").removeClass("open").addClass("closed");
content.slideDown();
hdr.removeClass("closed").addClass("open");
}
e.preventDefault();
$(this).blur();
});
content.hide();
hdr.addClass("closed");
});
});