亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

基于jquery實(shí)現(xiàn)的移入頁面上空文本框時(shí),讓它變?yōu)榻裹c(diǎn),移出清除焦點(diǎn)

 更新時(shí)間:2011年07月26日 20:19:45   作者:  
基于jquery實(shí)現(xiàn)的移入頁面上空文本框時(shí),讓它變?yōu)榻裹c(diǎn),移出清除焦點(diǎn)的實(shí)現(xiàn)代碼。
復(fù)制代碼 代碼如下:

var Page_INIT = function () {
$(document).bind("mouseover", function (e) {//鼠標(biāo)移入
if (e.target.tagName.toUpperCase() == "INPUT") {
var input = e.target;
if (input.type == "text") {//如果是文本框
if (window.Page_FocusTimer) {//如果處于焦點(diǎn)狀態(tài)
window.clearTimeout(window.Page_FocusTimer);//清除焦點(diǎn)狀態(tài)
}
window.Page_FocusTimer = window.setTimeout(function () { //每0.2豪秒去執(zhí)行這個(gè)匿名方法一次
if (!input.value) {//如果內(nèi)容為空,則設(shè)為焦點(diǎn)
try {
input.focus();
} catch (e) { }
}
}, 200);
}
}
}).bind("mouseout", function (e) {//鼠標(biāo)移出
if (e.target.tagName.toUpperCase() == "INPUT") { //被處理的事件源對象它的名稱(即HTML標(biāo)記)轉(zhuǎn)為大寫后如果是INPUT
var input = e.target;
if (input.type == "text") {
if (window.Page_FocusTimer) {
window.clearTimeout(window.Page_FocusTimer);
}
}
}
});
}

相關(guān)文章

最新評論