There is a gallery which reads the data from a database.
Below of that there are some circles which shows the number of all data or records.
Each time a circle turns to yellow which indicates that what is the active post.
I have generate this mechanism by this way :
function drawCircles(activeIndex) {
var off_html = '<img class="post_circle" src="../themes/dark/images/off.png"/>';
var on_html = '<img class="post_circle" src="../themes/dark/images/on.png" />';
$('#circles').empty();
for (var i = 1; i <= pcount; i++) {
if (i != activeIndex) {
$(off_html).appendTo($('#circles'));
}
else {
$(on_html).appendTo($('#circles'));
}
}
}
PCount = Count of All Posts...
#circles div is a bar which circles are in it.**
when we call
drawCircles(2)
The second circle turns to yellow. Now I want to make a click event for that.I want to understand which circle has been clicked? I have tried .live function , but I can't found that which circle has been clicked...