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>
收到好多消息,让我聊一下阿里云国际版本,作为一个阿里云死忠粉,之前用的服务器都是阿里云国内版的VPS主机,对于现在火热的阿里云国际版,这段时间了解了下,觉得还是有很多部分可以聊的,毕竟,实名制的服务器规则导致国际版无需实名这一特点被无限放大。以前也写过几篇综合性的阿里云国际版vps的分析,其中有一点得到很多人的认同,那句是阿里云不管国内版还是国际版的IO读写速度实在不敢恭维,相对意义上的,如果在这...
木木云怎么样?木木云品牌成立于18年,此为贵州木木云科技有限公司旗下新运营高端的服务器的平台,目前已上线美国中部大盘鸡,母鸡采用E5-267X系列,硬盘全部组成阵列。目前,木木云美国vps进行了优惠促销,1核1G/500M带宽/1T硬盘/4T流量,仅35元/月。点击进入:木木云官方网站地址木木云优惠码:提供了一个您专用的优惠码: yuntue目前我们有如下产品套餐:DV型 1H 1G 500M带宽...
目前国内云计算市场竞争异常激烈,尤其是国内的腾讯云、阿里云、景安等商家促销活动一波接一波的进行,对于有需要的用户确实得到不小的实惠。但是这样给予国内的主机商确实是比较大的打击,毕竟这些商家的背景和实例强劲,即便是贴本补贴优惠,也是不怕的。前两年阿里一家各种活动促销,确实在国内市场占据主要的市场地位,腾讯云开始两年没有较大的吸引用户,不过这两年的发展还是比较稳健的。我们很多网友在之前肯定也享受到一些...