-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
53 lines (46 loc) · 1.56 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="js/jquery-1.4.js"></script>
<script type="text/javascript" src="js/element-resize-detector.js"></script>
<script type="text/javascript" src="js/ResizeSensor.js"></script>
<style type="text/css">
div + .resize-container {
margin-top: 15px;
}
</style>
</head>
<body>
<div class="resize-container ResizeSensor-container">
<b>ResizeSensor.js</b>:
<span class='resized'>0</span>
<p>
Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet
</p>
</div>
<div class="resize-container element-resize-detector-container">
<b>element-resize-detector</b>:
<span class='resized'>0</span>
<p>
Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet
</p>
</div>
<script>
$(function() {
new ResizeSensor($('.ResizeSensor-container p'), function() {
$('.ResizeSensor-container .resized').text($('.ResizeSensor-container .resized').text() * 1 + 1);
});
$('.ResizeSensor-container p').css("line-height", '50px');
var erd = elementResizeDetectorMaker({
strategy: "scroll",
callOnAdd: true,
debug: true
});
erd.listenTo($('.element-resize-detector-container p')[0], function() {
$('.element-resize-detector-container .resized').text($('.element-resize-detector-container .resized').text() * 1 + 1);
});
$('.element-resize-detector-container p').css("line-height", '50px');
});
</script>
</body>
</html>