var i0=document.getElementById( 'output' ).getElementsByClassName( 'cmline' )[0].getElementsByTagName( 'input' )[1].value=== null ? 0 : document.getElementById( 'output' ).getElementsByClassName( 'cmline' )[0].getElementsByTagName( 'input' )[1].value;
context.xCoordinate=xCoordinate;
context.yCoordinate=yCoordinate;
context.cell=cell;
context.x=x;
context.y=y;
if ((point==1) || (point==2))
{
var f=addPart.bind(context);
f();
}
$('.first_div > img').each(function(i, elem) {
ref('.first_div > img', 0)
//console.log(lefted)
});
$('.sekond_div > img').each(function(i, elem) {
ref('.sekond_div > img', 0)
//console.log(lefted)
});
$('.sird_div > img').each(function(i, elem) {
ref('.sird_div > img',0)
//console.log(lefted)
});
});
function ref(name,itt){
itt++;
console.log(itt);
var lefted = -20 * itt;
$(name).eq(itt_3).css({
'left': lefted + 'px'
});
}
but.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String vz = otv1.getText().toString();
int otv11 = Integer.parseInt(vz);
if (sum == otv11) {
txt3.setText("Правильно, вы угадали!");
im.setImageDrawable(getResources().getDrawable(R.drawable.fon1));
} else {
txt3.setText("Неправильно, правильный ответ: " + sum + ".");
im.setImageDrawable(getResources().getDrawable(R.drawable.fon2));
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Timer timer = new Timer("change");
Task task = new Task();
timer.schedule(task, 2000);
}
});
}
class Task extends TimerTask {
@Override
public void run() {
im.setImageDrawable(getResources().getDrawable(R.drawable.fon));
}
}