this
is not a local variable, so it isn't saved in the closure. You need to bind a local variable to it:
$(document).ready(function () {
$("#leftsettingswindow").on("keyup", "#fontsize2", function () {
var savedThis = this;
setTimeout(function () {
var txtVal = savedThis.value;
$('#content').css("font-size", txtVal + "%");
}, 3000);
});
});