jQuery 价格显示 前面位数与后面两位显示不同样式(一大一小)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>价格显示</title>
<script src="scripts/jquery-1.7.1.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function(){
// 价格显示
$(".index_price").each(function(){
$(this).html('<span class="big_price">' + $(this).html().split('.').join('.</span><span class="small_price">') + '</span>');
});
})
</script>
<span>¥</span><span class="index_price">987.88</span>
<style>
.big_price {font-size:20px;}
.small_price {font-size:14px;}
</style>
</body>
</html>

记录平时的一些小问题~
或转载一些小知识点
学习学习

浙公网安备 33010602011771号