jQuery多余内容显示省略号,控制长度显示省略号
包括控制高度,长度,按照设置的内容显示省略号
XML/HTML Code
- <div id="wrapper" >
- <div class="example">
- <p><strong>Text only:</strong></p>
- <div class="l">
- <p class="before">before:</p>
- <div class="box before">freejs已经发了不少无刷新翻页的代码了,点击右侧“相关文章”可以找到,这边这个不同在于多了一个跳转页面。
- 数据库与本站其他翻页的相同,本例和《jquery 无刷新翻页》均是非常实用的案例,而且本例更简单易懂
- <p>本例与<a href="http://www.freejs.net/article_fenye_22.html">《Jquery一页内翻页,类似于无刷新分页》</a>很相近而区别与其他本站发布的翻页代码</p>
- <p>翻页文件一次加载了全部的内容,因而不是很适合大型的网站,而适用于数据比较少的情况。</p>
- <p>本例未使用数据库。</p>
- </div>
- </div>
- <div class="r">
- <p class="after">after:</p>
- <div class="box after" id="dot1">freejs已经发了不少无刷新翻页的代码了,点击右侧“相关文章”可以找到,这边这个不同在于多了一个跳转页面。
- 数据库与本站其他翻页的相同,本例和《jquery 无刷新翻页》均是非常实用的案例,而且本例更简单易懂
- <p>本例与<a href="http://www.freejs.net/article_fenye_22.html">《Jquery一页内翻页,类似于无刷新分页》</a>很相近而区别与其他本站发布的翻页代码</p>
- <p>翻页文件一次加载了全部的内容,因而不是很适合大型的网站,而适用于数据比较少的情况。</p>
- <p>本例未使用数据库。</p>
- </div>
- </div>
- </div>
- <div class="example">
- <p><strong>Text with markup:</strong></p>
- <div class="l">
- <p class="before">before:</p>
- <div class="box before">
- <p><em>Lorem Ipsum</em> is simply dummy text of the <strong>printing</strong> and <strong>typesetting industry</strong>.</p>
- <p><em>Lorem Ipsum</em> has been the industry's standard dummy text ever since <strong>the 1500s</strong>, when an unknown printer took a <em>galley of type</em> and scrambled it to make a type specimen book.</p>
- <p>It has survived not only <strong>five centuries</strong>, but also the leap into <strong>electronic typesetting</strong>.</p>
- </div>
- </div>
- <div class="r">
- <p class="after">after:</p>
- <div class="box after" id="dot2">
- <p><em>Lorem Ipsum</em> is simply dummy text of the <strong>printing</strong> and <strong>typesetting industry</strong>.</p>
- <p><em>Lorem Ipsum</em> has been the industry's standard dummy text ever since <strong>the 1500s</strong>, when an unknown printer took a <em>galley of type</em> and scrambled it to make a type specimen book.</p>
- <p>It has survived not only <strong>five centuries</strong>, but also the leap into <strong>electronic typesetting</strong>.</p>
- </div>
- </div>
- </div>
- <div class="example">
- <p><strong>With an "after"-element:</strong></p>
- <div class="l">
- <p class="before">before:</p>
- <div class="box before">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. <a href="#" class="readmore">Read more »</a></div>
- </div>
- <div class="r">
- <p class="after">after:</p>
- <div class="box after" id="dot3">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. <a href="#" class="more">Read more »</a></div>
- </div>
- </div>
- <div class="example resize">
- <p><strong>Updating onWindowResize:</strong></p>
- <div class="l">
- <p class="before">before:</p>
- <div class="box before">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</div>
- </div>
- <div class="r">
- <p class="after">after:</p>
- <div class="box after" id="dot4">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</div>
- </div>
- </div>
- <div class="example">
- <p><strong>Truncate readable pathnames</strong></p>
- <div class="l">
- <p class="before">before:</p>
- <div class="box before pathname">
- <div class="pathname">www.freejs.net/index.html</div>
- <div class="pathname">http://freejs.net/article_fenye_49.html</div>
- </div>
- </div>
- <div class="r">
- <p class="after">after:</p>
- <div class="box after pathname" id="dot5">
- <div class="pathname">www.freejs.net/index.html</div>
- <div class="pathname">http://freejs.net/article_fenye_49.html</div>
- </div>
- </div>
- </div>
原文地址:http://www.freejs.net/article_jquerywenzi_173.html