-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
96 lines (79 loc) · 2.9 KB
/
demo.html
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE HTML>
<html>
<head>
<!-- jQuery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery-rescale.js"></script>
<title>jquery-rescale Demo</title>
<style type="text/css">
body {
font-family: Helvetica, sans-serif;
}
input {
width: 5em;
}
#controls {
border: 1px solid #aaa;
margin: .5em;
padding: .5em;
}
.rescale {
border: 1px solid #333;
-moz-box-shadow: 6px 6px 6px #666;
-webkit-box-shadow: 6px 6px 6px #666;
box-shadow: 6px 6px 6px #666;
}
</style>
</head>
<body>
<div>
<div id="controls" >
<label for="width">Width:</label>
<input id="width" name="width" type="text" value="200" />
<label for="height">Height:</label>
<input id="height" name="height" type="text" value="200" />
<label for="x">Center X %:</label>
<input id="x" name="x" type="text" value="50" />
<label for="y">Center Y %:</label>
<input id="y" name="y" type="text" value="50" />
<label for="distort">Distort:</label>
<input id="distort" name="distort" type="checkbox" checked />
<label for="direction">Scale direction:</label>
<select id="direction" name="direction">
<option value="-1">Contract Only</option>
<option value="0" selected>Expand or Contract</option>
<option value="1">Expand Only</option>
</select>
</div>
<div class="rescale" >
<div>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat
nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
<img src="http://upload.wikimedia.org/wikipedia/commons/2/21/Mandel_zoom_00_mandelbrot_set.jpg" height="200" />
</div>
<iframe class="rescale" src="http://en.wikipedia.org/" height="600" width="1000"></iframe>
</div>
<script type="text/javascript">
var rescale = function() {
$('.rescale').rescale(
$('#width').val(),
$('#height').val(),
{
x: $('#x').val(),
y: $('#y').val(),
distort: $('#distort').is(':checked'),
direction: $('#direction').val()
}
);
};
$('input,select').bind('change', rescale);
$(document).ready(rescale);
</script>
</body>
</html>