So I have this funny little problem, where I want to parse the IDs of images. Nothing too complicated... but weirdly enough, my code doesn't seem to work properly. It's weirdddd. Could any care to explain this? I feel blind for not being able to see the error myself.
Here's a snippet of the relevant code that fails to work:
//Toggling images using img-index variable.
img-index = 0;
img-src[0] = $("#ppsfb").attr("id");
img-src[1] = $("#gty").attr("id");
$("#cycle").click(function(){
//Since img-index is just a counter.
if (img-index < 2){
img-index = img-index + 1;
} else {img-index = 0;}
$(img-src[img-index]).fadeIn(1000);
});
[a-zA-Z_$][0-9a-zA-Z_$]*