focus type answer area after it's appeared

This commit is contained in:
Damien Elmes 2017-07-31 16:34:30 +10:00
parent 412d37fc13
commit d6c8c6e272

View File

@ -38,16 +38,17 @@ function _showQuestion(q, a, bodyclass) {
_makeHidden($("#"+currentAns));
// and reveal question when processing is done
MathJax.Hub.Queue(function () {
$("#_question").css("visibility", "visible").fadeTo(fadeTime, 1);
$("#_question").css("visibility", "visible").fadeTo(
fadeTime, 1, function () {
// focus typing area if visible
typeans = document.getElementById("typeans");
if (typeans) {
typeans.focus();
}
});
});
});
// focus typing area if visible
typeans = document.getElementById("typeans");
if (typeans) {
typeans.focus();
}
// return to top of window
window.scrollTo(0, 0);