明霞山资源网 Design By www.htccd.com
复制代码 代码如下:
var Page_INIT = function () {
$(document).bind("mouseover", function (e) {//鼠标移入
if (e.target.tagName.toUpperCase() == "INPUT") {
var input = e.target;
if (input.type == "text") {//如果是文本框
if (window.Page_FocusTimer) {//如果处于焦点状态
window.clearTimeout(window.Page_FocusTimer);//清除焦点状态
}
window.Page_FocusTimer = window.setTimeout(function () { //每0.2豪秒去执行这个匿名方法一次
if (!input.value) {//如果内容为空,则设为焦点
try {
input.focus();
} catch (e) { }
}
}, 200);
}
}
}).bind("mouseout", function (e) {//鼠标移出
if (e.target.tagName.toUpperCase() == "INPUT") { //被处理的事件源对象它的名称(即HTML标记)转为大写后如果是INPUT
var input = e.target;
if (input.type == "text") {
if (window.Page_FocusTimer) {
window.clearTimeout(window.Page_FocusTimer);
}
}
}
});
}
var Page_INIT = function () {
$(document).bind("mouseover", function (e) {//鼠标移入
if (e.target.tagName.toUpperCase() == "INPUT") {
var input = e.target;
if (input.type == "text") {//如果是文本框
if (window.Page_FocusTimer) {//如果处于焦点状态
window.clearTimeout(window.Page_FocusTimer);//清除焦点状态
}
window.Page_FocusTimer = window.setTimeout(function () { //每0.2豪秒去执行这个匿名方法一次
if (!input.value) {//如果内容为空,则设为焦点
try {
input.focus();
} catch (e) { }
}
}, 200);
}
}
}).bind("mouseout", function (e) {//鼠标移出
if (e.target.tagName.toUpperCase() == "INPUT") { //被处理的事件源对象它的名称(即HTML标记)转为大写后如果是INPUT
var input = e.target;
if (input.type == "text") {
if (window.Page_FocusTimer) {
window.clearTimeout(window.Page_FocusTimer);
}
}
}
});
}
标签:
焦点
明霞山资源网 Design By www.htccd.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
明霞山资源网 Design By www.htccd.com
暂无评论...