我无法访问 settimeout 函数中的变量,即在以下示例中 setTimeout(pop.hide()), 3000); 这里pop.hide()在 settimeout 内不起作用...
任何解决方案..
HTML
<div id="logincheck"></div>
JS:
function logClick() {
var sEmail = $('#username').val();
var sPassword = $('#password').val();
var pop = $('#logincheck');
if (($.trim(sEmail).length == 0) && ($.trim(sPassword).length == 0)) {
pop.show();
pop.html('Enter EmailId and Password ');
setTimeout(pop.hide()), 3000);
}
谢谢 AB