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>
imidc怎么样?imidc彩虹数据或彩虹网络现在促销旗下日本多IP站群独立服务器,原价159美元的机器现在只需要88美元,而且给13个独立IPv4,30Mbps直连带宽,不限制月流量!IMIDC又名为彩虹数据,rainbow cloud,香港本土运营商,全线产品都是商家自营的,自有IP网络资源等,提供的产品包括VPS主机、独立服务器、站群独立服务器等,数据中心区域包括香港、日本、台湾、美国和南非...
Nocser刚刚在WHT发布了几款促销服务器,Intel Xeon X3430,8GB内存,1TB HDD,30M不限流量,月付$60.00。Nocser是一家注册于马来西亚的主机商,主要经营虚拟主机、VPS和马来西亚独立服务器业务,数据中心位于马来西亚AIMS机房,线路方面,AIMS到国内电信一般,绕日本NTT;联通和移动比较友好,联通走新加坡,移动走香港,延迟都在100左右。促销马来西亚服务器...
俄罗斯vps速度怎么样?俄罗斯vps云主机节点是欧洲十大节点之一,地处俄罗斯首都莫斯科,网络带宽辐射周边欧洲大陆,10G专线连通德国法兰克福、法国巴黎、意大利米兰等,向外连接全球。俄罗斯vps云主机速度快吗、延迟多少?由于俄罗斯数据中心出口带宽充足,俄罗斯vps云主机到全球各地的延迟、速度相对来说都不错。今天,云服务器网(yuntue.com)小编介绍一下俄罗斯vps速度及俄罗斯vps主机推荐!俄...