Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Jeffrey Way November 22, 2011
file 60 lines (39 sloc) 0.914 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
<!doctype html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>

<div class="container grid">
<form>
<h2>HTML</h2>
<textarea id="html"></textarea>

<h2>CSS</h2>
<textarea id="css"></textarea>
</form>
</div>

<div class="output grid">
<iframe></iframe>
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>

<script src="http://localhost:35729/livereload.js"></script>

<script>
(function() {
$('.grid').height( $(window).height() );

var contents = $('iframe').contents(),
body = contents.find('body'),
styleTag = $('<style></style>').appendTo(contents.find('head'));

$('textarea').keyup(function() {
var $this = $(this);
if ( $this.attr('id') === 'html') {
body.html( $this.val() );
} else {
// it had to be css
styleTag.text( $this.val() );
}
});

})();

</script>

</body>
</html>









Something went wrong with that request. Please try again.