placeholder效果适配IE8(2)
来源:互联网 发布:java类加载机制面试题 编辑:程序博客网 时间:2024/05/23 21:37
<style type="text/css">.phcolor {color: #999;}</style>
<script type="text/javascript"> $(function(){ //判断浏览器是否支持placeholder属性 supportPlaceholder='placeholder'in document.createElement('input'), placeholder=function(input){ var text = input.attr('placeholder'), defaultValue = input.defaultValue; if(!defaultValue){ input.val(text).addClass("phcolor"); } input.focus(function(){ if(input.val() == text){ $(this).val(""); } }); input.blur(function(){ if(input.val() == ""){ $(this).val(text).addClass("phcolor"); } }); //输入的字符不为灰色 input.keydown(function(){ $(this).removeClass("phcolor"); }); }; //当浏览器不支持placeholder属性时,调用placeholder函数 if(!supportPlaceholder){ $('input').each(function(){ text = $(this).attr("placeholder"); if($(this).attr("type") == "text"){ placeholder($(this)); } }); } });</script>
0 0
- placeholder效果适配IE8(2)
- placeholder效果适配IE8(1)
- placeholder效果适配IE8(3)
- IE8兼容placeholder
- placeholder兼容IE8解决方案
- placeholder兼容到ie8
- placeholder兼容IE8代码
- ie8浏览器不支持placeholder属性
- 解决ie8不支持placeholder方法
- IE8 placeholder 无法显示问题
- 模拟placeholder效果
- textView实现placeholder效果
- textarea模拟placeholder效果
- 浏览器PlaceHolder效果
- ios UITextView placeHolder效果
- 模拟placeholder效果
- IE8及以下版本HTML5 placeholder解决方案
- IE8下placeholder提示信息的展示
- 程序猿需要了解的CPU Cache
- Myeclipse下部署项目以及JSP的连接
- Html控件和Web控件的比较分析
- iOS 手势笔记
- 物联网通信第一天
- placeholder效果适配IE8(2)
- iOS界面布局之四——使用第三方库Masonry进行autolayout布局
- 接口和抽象类有什么区别
- 【阅读】不懂产品的SEO不是一个合格的好运营
- 使用JDBC连接数据库并且调用存储过程和执行SQL语句
- RMQ模板
- 【二维01背包+限制条件】HDU3236-Gift Hunting
- NotificationCenter、KVO、Delegate
- java web项目入门知识框架