Variables vvi and hhi should be with for loop turned into vv1...vv30 and hh1, hh2...hh30. Now I can't get variables tv, lv, bv and rv to return the variable(vv1 or hh1...) value instead if I put vv into quotes it turns the variable into a string (with value: vv1 or vv2...) or if vv isn't in quotes it doesn't work. I'm not good at explaining but if you know what I am talking about please help.
for(i = 1; i <= 30; i++){
var o = $("#v"+i).css("opacity");
if(o < 1){
var vvi = 0;
}else{
var vvi = 1;
}
var o = $("#h"+i).css("opacity");
if(o < 1){
var hhi = 0;
}else{
var hhi = 1;
}
var cl = parseInt($("#"+i).attr('class'));
var id = parseInt($("#"+i).attr('id'));
var top = cl;
var left = id;
var bottom = cl+5;
var right = id+5;
var tv = vv+top;
var lv = hh+left;
var bv = vv+bottom;
var rv = hh+right;
var result = tv+lv+bv+rv;
if(result==4){
$('#'+i).html("X");
}
//alert(result);
}