搜索文本框焦点离开时文本位置跳动问题解决方法
摘要:搜索文本框焦点离开时设置文本,位置跳动问题//搜索文本框$("#txtSearch").focus(function(){if($(this...
搜索文本框焦点离开时设置文本,位置跳动问题
//搜索文本框
$("#txtSearch").focus(function () {
if ($(this).val() == "请输入搜索关键字") {
$(this).val("");
$(this).css("color", "black");
}
}).blur(function () {
if ($(this).val() == "") {
$(this).css("color", "gray").val("请输入搜索关键字");
}
});
在css中加入
#txtSearch
{
width:480px;
height:20px;
vertical-align:middle;
}
【搜索文本框焦点离开时文本位置跳动问题解决方法】相关文章:
★ 怎样做出大气的网页作品 设计大气的网页的方法(图文教程)
★ 正确的空链接写法 防止点击后页面会跳动问题 a href #号问题
上一篇:
css 样式加载的优先级使用经验分享
下一篇:
css技巧收藏——经典中的经典