我究竟做错了什么?我正在尝试显示与 class="likes" 的初始值相对应的条形图
这是小提琴 http://jsfiddle.net/sghoush1/VU3LP/40/
Jquery 看起来像这样
var baractive = $('<div class="barActive"></div');
baractive.appendTo('.bar');
function checkNumber() {
var valueCurrent = parseInt($(".likes").text());
if(isNaN(valueCurrent) || valueCurrent <= 20) {
$(".barActive").css('height', '20px').css('width', '30px').css('background', 'green');
}
if(isNaN(valueCurrent) || valueCurrent <= 60) {
$(".barActive").css('height', '20px').css('width', '80px').css('background', 'green');
}
}
checkNumber();