我是 jQuery 新手,所以我有 2 个问题。
1-如何在此功能中突出显示单词之间的空格?
2-如何突出显示<abbr class="word p1">
标签?
HTML 代码:
<span id="4">
<abbr class="word p1" >ﭢ</abbr>
<abbr class="word p1" >ﭣ</abbr>
<abbr class="word p1" >ﭤ</abbr>
<abbr class="word p1" >ﭥ</abbr>
<abbr class="end p1" >ﭦ</abbr>
</span >
JavaScript 代码:
$(function(){
var time = 5;
$("abbr", "#4").each(function(i,e) {
$(e).delay(i*((time*1000)/$("abbr", "#4").length)).animate({'background-color': '#0f0'}, 500);
});
});
CSS代码:
span
{
text-align:justify;
float:right;
}
@font-face {
font-family: 'p1';
src: url('http://c216429.r29.cf1.rackcdn.com/p1.eot?#iefix') format('embedded- opentype'),
url('http://c216429.r29.cf1.rackcdn.com/p1.woff') format('woff'),
url('http://c216429.r29.cf1.rackcdn.com/p1.ttf') format('truetype'),
url('http://c216429.r29.cf1.rackcdn.com/p1.svg#p1') format('svg');
}
.p1 {
font-family: 'p1';
}
演示:http: //jsfiddle.net/eTyaV/