I have four divs in my html page something like this: the working fiddle implementation is here: http://jsfiddle.net/GxaCK/3/
<div class="first">
<p> First </p>
</div>
<div class="second">
<p> Second </p>
</div>
<div class="third">
<p> Third </p>
</div>
<div class="fourth">
<p> Fourth </p>
</div>
以及随后的 j:
$(function() {
var firstCnt = 0,
secondCnt = 0,
thirdCnt = 0,
fourthCnt = 0;
$(".first").live("click", function(){
firstCnt += 1;
$(".first p").text(firstCnt);
});
$(".second").live("click", function(){
secondCnt += 1;
$(".second p").text(secondCnt);
});
});
现在可以这样做。 如果四舍五入点被点击或奇数倍,则将获得一定百分比。
I have the following doubt: 1. is this a goodway of implementation, in a project? 2. is there anything like even odd selector for clicks as well, as exists in css3