我需要爲我的應用程序創建通知計數器。目前,我想在每個按鈕點擊的圖片上添加越來越多的。這怎麼能用jQuery來實現?
JSfiddlejQuery - 爲每次點擊添加越來越多的圖像
HTML:
<img id="header_bell_notificator" class="show_notif" src="http://www.gsi.co.ir/Docs/Images/Red_Circle.png" alt="" width="30px">
<button id="kick_button">click this</button>
CSS:
.show_notif{
visibility: hidden;
}
JS:
var counter=0;
$("#kick_button").click(function() {$("#header_bell_notificator").removeClass("show_notif");
});
試試這個http://jsfiddle.net/vk5j72s3/你需要額外的格計數器 –
謝謝,但我需要這個數字在圖像上。 – undroid
http://jsfiddle.net/vk5j72s3/1/只是將櫃檯移動到正確的位置:) –