forked from henrik/jquery.truncator.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
59 lines (47 loc) · 1.79 KB
/
example.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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jQuery HTML Truncator</title>
<script language="javascript" type="text/javascript" src="jquery-1.2.6.js"></script>
<script language="javascript" type="text/javascript" src="jquery.truncator.js"></script>
<script language="javascript" type="text/javascript">
$(function() {
$('.example').truncate({max_length: 24});
});
</script>
<style type="text/css">
table { border-collapse: collapse; }
td, th { border: 1px solid #000; }
</style>
</head>
<body>
<h1>jQuery HTML Truncator</h1>
<p>By <a href="http://henrik.nyh.se">Henrik Nyh</a>. See <a href="http://henrik.nyh.se/2008/02/jquery-html-truncate">the blog post</a>.</p>
<h2>Example 1</h2>
<div class="example">
<p>
Text!
</p>
<p>
Föö & <em>bar</em> baz!
</p>
<p>Giant <strong title="fool">baby</strong> head.</p>
</div>
<h2>Example 2</h2>
<div class="example">
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>
<h2>Example 3: Handling HTML entities</h2>
<div class="example">
<p>&amp; <b>old</b> foo bar.</p>
</div>
<h2>Example 4: Handling tables</h2>
<div class="example">
<p>Hello!</p>
<table>
<tr><th>Foo</th><th>Bar</th></tr>
<tr><td>Lauren</td><td>Ipsum</td></tr>
</table>
</div>
</body>
</html>