$().ready(function() {
//输入框键盘按键松开事件
$("#shuru").keyup(function() {
$.post("bsbcUser.aspx?username=" + $("#shuru")[0].value, function(data) {
$("#testDIV").show();
$("#testDIV").empty();
$("#testDIV").append(data);
//偶数行
//$("tr:odd").css("background-color", "#e5e5e5");//背景色
$("tr:odd").each(function() {
});
//奇数行
$("tr:even").each(function() {
//单击事件
$(this).click(function() {
});
});
});
/*****************/
//设置div位置,在input后面
var shuru = $("#shuru");
var offset = shuru.offset();
$("#testDIV").css('left', offset.left + shuru.width() + 2 + 'px')
.css('top', offset.top + 'px')
.css('position', 'absolute')
.css('z-index', '99')
.fadeIn();
/******************/
//Div鼠标滑过事件
$("#testDIV").mouseover(
function() {
//firstCol列添加click事件,给其他控件赋值
$(".firstCol").click(function() {
$("#shuru").val($(this).text());
$("#testDIV").empty();
});
}
);
$("#testDIV").mouseleave(
function() {
//置空div
$("#testDIV").empty();
}
);
/******************/
//回车事件
// $(window).keydown(function(event) {
// switch (event.keyCode) {
// ...
// 不同的按键可以做不同的事情
// 不同的浏览器的keycode不同
// 更多详细信息: http://unixpapa.com/js/key.html
//case 13:
// break;
// }
// });
/*******************/
});
});
请在下面的输入框中键入字母(A - Z):