如何设置样式阅读更多使用CSS3
How to style "Read More" using CSS3
下面是我的JQuery函数。我想将CSS样式应用于"Read More"answers"Read Less"文本,这是函数的一部分。我们怎么做呢?
$(document).ready(function() {
$('.YourName').jTruncate({
length: 25,
minTrail: 0,
moreText: "Read More",
lessText: "Read Less",
ellipsisText: "...",
});
});
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://tester3.yolasite.com/resources/javascript/jtruncate.js"></script>
<p class="YourName">Hello, Text will truncate after 25 characters and a "Read More" link will be appended to it. Here is some more text. Here is some more text. Here is some more text. Here is some more text. Here is some more text. Here is some more more text. Here is some more text. Here is some more text. This is the end.</p>
moreText: "<span class='moreText'>Read More</span>", // The text to use for the "more" link.
lessText: "<span calss='readLess'>Read Less</span>", // The text to use for the "less" link.
然后在你的CSS样式中像往常一样…
.moreText{/* styles here */}
.readLess{/* styles here */}
相关文章:
- 当包含另一个asp文件时,是否也包含所有引用的样式和脚本页面
- 将样式表插入iframe
- 跟踪在页面加载时应用内联样式的JavaScript
- 如果文本字段为空,则使用JavaScript应用CSS样式
- 定义完全独立的样式信息
- W3C循环样式的JavaScript
- jQuery/JavaScript在线公文包表单-打印样式表
- 使用递归、Ramda.js和无点样式重构字符串的getPermutations()
- FF和Chromium中CSS样式按钮的外观差异
- 如何首先设置样式<td>表中包含在窗体中的元素
- javascript问题正文样式
- 使用具有内联样式的tidy-html5
- DataTables-创建自定义分页样式(加载更多样式)
- 我将如何使用CSS3对动态创建的jQuery UI元素进行样式设置
- CSS3 颜色样式在使用 javascript 删除类后仍然存在
- HTML5/CSS3输入范围样式
- CSS3样式属性中的布尔值
- 如何设置样式阅读更多使用CSS3
- CSS3 Flip Dropdown Menu-将鼠标悬停在子菜单上时保留主菜单悬停样式
- 使用 CSS3 进行条件样式设置