大佬教程收集整理的这篇文章主要介绍了jQuery datepicker在IE8中遇到麻烦?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我将我的datepicker更新为jQuery UI Datepicker 1.8.11 …但它仍然无法在IE 8中运行!弹出日期选择器就好了,但没有事件发生.我是说没有点击……没有任何反应……
有任何想法吗?
yearRange: '-100:+10'
例如 …
这是您解决问题的方法:从http://satish.name/?p=19复制
jQuery datepicker在IE中为DOM元素添加了一个新属性.如果您尝试从现有元素动态复制添加新DOM元素,则datepicker将无法在IE中工作,因为新添加的DOM元素引用旧的jQuery属性.解决此问题的一种方法是删除属性,然后在元素上实例化datepicker类.请参阅以下代码以获取此修复程序.
//newDiv is the new added dom element with innerHTML jQuery("#newDiv").find(".datePicker").each(function() { //removing jquery added attribute as this is causing the dynamically // added DOM elem referring old DOM element from it is copied. if (jQuery.browser.msiE) { var jqaddedattr; jQuery(this.attributes).each(function() { if (this.name.search(/jQuery/) != -1) { jqaddedattr = this; } }); if (jqaddedattr) { jQuery(this).removeAttr(jqaddedattr.Name); } } jQuery(this).datepicker({yearRange: '-100:+10',changeFirstDay:falsE}).val("").trigger('change'); })
干杯
以上是大佬教程为你收集整理的jQuery datepicker在IE8中遇到麻烦?全部内容,希望文章能够帮你解决jQuery datepicker在IE8中遇到麻烦?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。