Skip to content

Instantly share code, notes, and snippets.

@momolog
Created September 24, 2014 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save momolog/e06374d3d0659f7c2c6c to your computer and use it in GitHub Desktop.
Save momolog/e06374d3d0659f7c2c6c to your computer and use it in GitHub Desktop.
wkhtmltopdf and packery
<html>
<head>
<meta charset="utf-8"/>
<script type="text/javascript" charset="utf-8" src="packery.pkgd.min.js"></script>
<script type="text/javascript" charset="utf-8">
window.onload = function(){
var debug = document.querySelector('#debugger');
debug.innerHTML += "<h1>Hello</h1>";
debug.innerHTML += Packery;
var container = document.querySelector('#container');
var pckry = new Packery( container, {
itemSelector: '.item',
gutter: 10
});
}
</script>
<style>
body { border: 1px solid red; width: 23cm}
.item { width: 25%; border: 1px solid blue}
.item.w2 { width: 50%; }
.item.h2 { height: 50px }
</style>
</head>
<body>
<div id="debugger"></div>
<div id="container">
<div class="item">Opa</div>
<div class="item w2">Oma</div>
<div class="item">Papa</div>
<div class="item">Mama</div>
<div class="item h2">Rüdi</div>
<div class="item">Lotta</div>
<div class="item">Lena</div>
<div class="item">Lara</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment