日期:2014-05-16 浏览次数:20355 次
....
<ul>
<li>
<a class="music">音乐</a>
<a class="photo">相册</a>
<a class="blog">日志</a>
</li>
</ul>
.....
var Turl=location.href;
var patt = /\/(.*?).html/g
var TmpClass="";
while ((result = patt.exec(str)) != null) {
TmpClass='.'+result[1];
}
$(TmpClass).css('background-color','red'); //为对应的类设置样式.