See this fiddle: http://jsfiddle.net/scottbeeson/PTh4U/
Here's my dilemma: if I use incremental z-index, like say click(z-index += 1) the user could click on the top most element 100 times rendering the next click on a lower object useless. The way I'm doing it currently, as in the fiddle, I'm setting all like elements to the base z-index and then setting the current one higher.
$(document).on('click','.tile',function() {
$('.tile').css('z-index','10');
$(this).css('z-index','100');
});
This works for the most part, but it has a bit of odd behavior that you can see if you just click around a couple times. Namely, the last clicked item sometimes goes further back (I guess items with the same index are arbitrarily chosen to be on top or not?).