星期jquery ui datepicker ie8 使用的基本解决方法

datepicker  时间:2021-01-29  阅读:()

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: '&#x3c;上月' ,nextText: '下月&#x3e; ' ,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>

热网互联33元/月,香港/日本/洛杉矶/韩国CN2高速线路云主机

热网互联怎么样?热网互联(hotiis)是随客云计算(Suike.Cloud)成立于2009年,增值电信业务经营许可证:B1-20203716)旗下平台。热网互联云主机是CN2高速回国线路,香港/日本/洛杉矶/韩国CN2高速线路云主机,最低33元/月;热网互联国内BGP高防服务器,香港服务器,日本服务器全线活动中,大量七五折来袭!点击进入:热网互联官方网站地址热网互联香港/日本/洛杉矶/韩国cn2...

ATCLOUD.NET-OVH海外高防云主机,采用KVM架构,稳定安全且便宜好用,仅3刀起

官方网站:点击访问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...

CUBECLOUD:香港服务器、洛杉矶服务器、全场88折,69元/月

CUBECLOUD(魔方云)成立于2016年,亚太互联网络信息中心(APNIC)会员,全线产品均为完全自营,专业数据灾备冗余,全部产品均为SSD阵列,精品网络CN2(GIA) CU(10099VIP)接入,与当今主流云计算解决方案保持同步,为企业以及开发者用户实现灵活弹性自动化的基础设施。【夏日特促】全场产品88折优惠码:Summer_2021时间:2021年8月1日 — 2021年8月8日香港C...

datepicker为你推荐
闪迪和金士顿哪个好固态硬盘哪个好,是金士顿好还是闪迪的华为p40和mate30哪个好荣耀30pro和华为p40对比。,哪个更值得入手?录音软件哪个好录音软件哪个好炒股软件哪个好股票软件哪个最好用?无纺布和熔喷布口罩哪个好大雾天气带什么样的口罩最好oppo和vivo哪个好OPPO手机和vivo手机哪个好?红茶和绿茶哪个好红茶和绿茶哪个更好?雅思和托福哪个好考托福、雅思哪个好考?视频软件哪个好安卓系统在线看视频软件哪个好美国国际集团IDG在美国是干什么的?
大庆服务器租用 二级域名查询 国外免费vps plesk iisphpmysql gomezpeer gspeed 135邮箱 静态空间 qq云端 美国网站服务器 流媒体加速 可外链的相册 七牛云存储 512内存 新网dns hosting24 vim 29美元 更多