JS 同步输入

var txtBigBalance;
//金额同步输入
if ($.browser.msie)//IE
{
$("#txtBalanceP").get(0).onpropertychange = getBalance;
$("#txtbigBalance").get(0).onpropertychange = eventHandler;
}
else {
var intervalName;
$("#txtBalanceP").get(0).addEventListener("input", getBalance, false);
$("#txtBalanceP").focus(function () {
intervalName = setInterval(eventHandler, 1000);
});
$("#txtBalanceP").blur(function () {
clearInterval(intervalName);
});
}
function getBalance() {
$("#txtbigBalance").val($(this).val());
}
function eventHandler() {
if ($("#txtbigBalance").val() != txtBigBalance) {
txtBigBalance = $("#txtbigBalance").val();
}
}

上一篇:study notes: high performance linux server programming


下一篇:为WIN8 APP创建置顶desktop应用