jquery版本不兼容
点击一下换月份和换年份 他直接就隐藏 怎么解决
我想在input的右边放一个日历小图标,通过点击小图标来触发日历事件,怎么弄?求解
this.monthNameSpan = $(".month_name", monthNav); $(".prev", monthNav).click(this.bindToObj(function(event) { this.moveMonthBy(-1); event.stopPropagation(); })); $(".next", monthNav).click(this.bindToObj(function() { this.moveMonthBy(1); event.stopPropagation(); })); var yearNav = $('<p class="year_nav">' + '<span class="button prev" title="[Ctrl+Page-Up]">«</span>' + ' <span class="year_name"></span> ' + '<span class="button next" title="[Ctrl+Page-Down]">»</span>' + '</p>'); this.yearNameSpan = $(".year_name", yearNav); $(".prev", yearNav).click(this.bindToObj(function() { this.moveMonthBy(-12); event.stopPropagation(); })); $(".next", yearNav).click(this.bindToObj(function() { this.moveMonthBy(12); event.stopPropagation(); }));
发现点击选择年月数的时候会触发冒泡时间,只需要在上述的点击事件中加上禁止冒泡事件即可解决
event.stopPropagation();