jQuery UI Datepicker IE8使用的基本解决方法
版本 jquery-ui-1.8.6.min. js
解决 IE8无法响应其中jquery.ui.datepicker部分标签a(无href)的onclick事件和td由于放入标签a href="#"无法响应自身onclick事件只验证了icon-trigger模式
方法
509行解决选择日期总小一
月:f. selectedDay=f.currentDay=d("a",e) .html () ;
改
为: if(e==e. toString() ) {f. selectedDay=f.currentDay=e; }else{f. selectedDay=f.currentDay=$('a' ,e) .html () ; } ;
525行解决上一月无效: '<a class="ui-datepicker-prevui-corner-all"onclick="DP_jQuery_'
改为: '<a class="ui-datepicker-prevui-corner-all"href="javascript:DP_jQuery_'
526行解决下一月无效: '<a class="ui-datepicker-next ui-corner-all"onclick="DP_jQuery_'
改为: '<a class="ui-datepicker-next ui-corner-all"href="javascript:DP_jQuery_'
532行去掉td响应click事件:+(J?"": 'onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a. id+"' , "+q.getMonth()+", "+q.getFullYear()+' , this) ;return false;"' )
直接删除
533行给标签a加入href: (B?" ui-priority-secondary":"")+' "href="#">'+q.getDate()+"</a>")
把href="#"改
为:href="javascript:DP_jQuery_'+y+' .datepicker._selectDay(\'#'+a. id+'\' , '+q.getMonth()+' , '+q.getFullYear()+' , '+q.getDate()+' ) ;"
效果图
使用范例如下
<html>
<head>
<link rel="stylesheet" type="text/css"href="styles/jquery-ui-redmond-1.8.6.css" />
<script src="scripts/jquery-1.4.2.min. js"type="text/javascript"></script>
<script src="scripts/jquery-ui-1.8.6.min. js"type="text/javascript"></script>
<style>
.ui-datepicker .ui-datepicker-title select
{font-size: 1em;margin: 1px 0;
}
.ui-datepickerselect.ui-datepicker-month-year
{width: 100%;
}
.ui-datepickerselect.ui-datepicker-month, .ui-datepickerselect.ui-datepicker-year
{width: 40%;
}
.ui-datepicker .ui-datepicker-title select.ui-datepicker-year
{float: left;
}
.ui-datepicker-div, .ui-datepicker-inline, #ui-datepicker-div
{font-size: 0.7em;
}
</style>
<script>
$(function () {
$.datepicker.regional[' zh-CN' ] = {closeText: '关闭' ,prevText: '<上月' ,nextText: '下月> ' ,currentText: '今天' ,monthNames: ['01月' , '02月' , '03月' , '04月' , '05月' , '06月' , '07月' , '08月' , '09月' , ' 10月' , ' 11月' , ' 12月' ] ,monthNamesShort: ['01月' , '02月' , '03月' , '04月' , '05月' , '06月' , '07月' , '08月' , '09月' , ' 10月' , ' 11月' , ' 12月' ] ,dayNames: ['星期日' , '星期一' , '星期二' , '星期三' , '星期四' , '星期五' , '星期六' ] ,dayNamesShort: ['周日' , '周一' , '周二' , '周三' , '周四' , '周五' , '周六' ] ,da六
dateFormat: 'yy-mm-dd' , f irstDay: 1,isRTL: false
} ;
$.datepicker. setDefaults($.datepicker.regional[' zh-CN' ]) ;
$("#datepicker") .datepicker( {showOn: "button",buttonImage: "images/calendar.gif",buttonImageOnly: true
} ) ;
//$('#datepicker' ) .datepicker('option' , { dateFormat:"y y-mm-d d" } ) ;
} ) ;
</script>
</head>
<body>
<input type="text" id="datepicker">
</body>
</html>
官方网站:点击访问ATCLOUD.NET官网优惠码:目前提供Cloud VPS与Storage VPS两款产品的六折优惠活动(续费同价,截止至2021年5月31日)优惠码:UMMBPBR20Z活动方案:一、型号CPU内存磁盘流量优惠价格购买链接VPS-1GB0.5×2.6+GHz1GB20GB1TB$3立即购买VPS-2GB1×2.6+GHz2GB50GB2TB$6立即购买VPS-4GB2×2.6...
hypervmart怎么样?hypervmart是一家成立了很多年的英国主机商家,上一次分享他家还是在2年前,商家销售虚拟主机、独立服务器和VPS,VPS采用Hyper-V虚拟架构,这一点从他家的域名上也可以看出来。目前商家针对VPS有一个75折的优惠,而且VPS显示的地区为加拿大,但是商家提供的测速地址为荷兰和英国,他家的优势就是给到G口不限流量,硬盘为NVMe固态硬盘,这个配置用来跑跑数据非常...
BGPTO是一家成立于2017年的国人主机商,从商家背景上是国内的K总和有其他投资者共同创办的商家,主营是独立服务器业务。数据中心包括美国洛杉矶Cera、新加坡、日本大阪和香港数据中心的服务器。商家对所销售服务器产品拥有自主硬件和IP资源,支持Linux和Windows。这个月,有看到商家BGPTO日本和新加坡机房独服正进行优惠促销,折扣最低65折。第一、商家机房优惠券码这次商家的活动机房是新加坡...