Skip to content

Commit 6ab83cc

Browse files
author
CitizenOfRome
committed
Grid example
1 parent 12a18d3 commit 6ab83cc

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

demo/index.html

+45
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
.a {
1717
background: black;
1818
color: white;
19+
padding: 0.5em 0.1em;
1920
}
2021
.b {
2122
color: #aaa;
23+
padding: 0.5em 0.1em;
2224
}
2325
#canvasExample {
2426
height: 5em;
@@ -27,6 +29,33 @@
2729
display: block;
2830
margin-bottom: 1em;
2931
}
32+
.grid-wrapper {
33+
display: grid;
34+
grid-gap: 0.125em;
35+
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr) ) ;
36+
background-color: #fff;
37+
color: #444;
38+
margin-bottom: 1em;
39+
page-break-inside: avoid;
40+
}
41+
.grid-wrapper .box {
42+
background-color: #444;
43+
color: #fff;
44+
border: 0.1em solid #444;
45+
border-radius: 5px;
46+
padding: 0.25em;
47+
font-size: 150%;
48+
}
49+
.grid-wrapper .a {
50+
grid-column: auto / span 2;
51+
}
52+
.grid-wrapper .k {
53+
grid-column: auto / span 3;
54+
}
55+
.grid-wrapper .g {
56+
grid-column: auto / span 2;
57+
grid-row: auto / span 2;
58+
}
3059
</style>
3160
<!--[if lt IE 9]>
3261
<script src="js/vendor/html5-3.6-respond-1.1.0.min.js"></script>
@@ -55,6 +84,22 @@ <h3>Element 2</h3>
5584
</p>
5685
Canvas:
5786
<canvas id="canvasExample"></canvas>
87+
Grid:
88+
<div class="grid-wrapper">
89+
<div class="box a">A</div>
90+
<div class="box b">B</div>
91+
<div class="box c">C</div>
92+
<div class="box d">D</div>
93+
<div class="box e">E</div>
94+
<div class="box f">F</div>
95+
<div class="box g">G</div>
96+
<div class="box h">H</div>
97+
<div class="box i">I</div>
98+
<div class="box j">J</div>
99+
<div class="box k">K</div>
100+
<div class="box l">L</div>
101+
<div class="box m">M</div>
102+
</div>
58103
<button class="print-link no-print">
59104
Print this ($.print("#ele2")) and skip the button (.no-print)
60105
</button>

dist/jQuery.print.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jQuery.print.js

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
var def = $.Deferred();
5858
try {
5959
frameWindow = frameWindow.contentWindow || frameWindow.contentDocument || frameWindow;
60+
try {
61+
frameWindow.resizeTo(window.innerWidth, window.innerHeight);
62+
} catch (err) {
63+
console.warn(err);
64+
}
6065
var wdoc = frameWindow.document || frameWindow.contentDocument || frameWindow;
6166
if(options.doctype) {
6267
wdoc.write(options.doctype);

0 commit comments

Comments
 (0)