想在this link上制作一些卷轴。 问题是在切换到不同区域后我无法阻止滚动1秒。已经在下面写了some code,但它有效,但有一些错误(例如上面你可以在区域转换发生时滚动。在我的代码中你可以。需要禁用非暂停转换)。
暂时解决这个问题,所以不胜感激。
<aui:script use='<%= "aui-datepicker" + (BrowserSnifferUtil.isMobile(request) ? "-native" : StringPool.BLANK) %>'>
Liferay.component(
'<%= nameId %>DatePicker',
function() {
var datePicker = new A.DatePicker<%= BrowserSnifferUtil.isMobile(request) ? "Native" : StringPool.BLANK %>(
{
container: '#<%= randomNamespace %>displayDate',
mask: '<%= mask %>',
<%
if((PortalUtil.getPortletNamespace(PortletKeys.JOURNAL)).equals(namespace) && name.equals("expirationDate")){
%>
calendar: {
maximumDate: new Date(<%= calendarCurrentDate.get(Calendar.YEAR)+1 %>, <%= calendarCurrentDate.get(Calendar.MONTH) %>, <%= calendarCurrentDate.get(Calendar.DAY_OF_MONTH) %>)
},
<%
}
%>
on: {
disabledChange: function(event) {
var instance = this;
var container = instance.get('container');
var newVal = event.newVal;
console.log('disalbedChange'+newVal)
container.one('#<%= dayParamId %>').attr('disabled', newVal);
container.one('#<%= monthParamId %>').attr('disabled', newVal);
container.one('#<%= nameId %>').attr('disabled', newVal);
container.one('#<%= yearParamId %>').attr('disabled', newVal);
},
selectionChange: function(event) {
var instance = this;
var container = instance.get('container');
var date = event.newSelection[0];
console.log("event >"+event);
console.log("date >"+date);
if (date) {
container.one('#<%= dayParamId %>').val(date.getDate());
container.one('#<%= monthParamId %>').val(date.getMonth());
container.one('#<%= yearParamId %>').val(date.getFullYear());
}
}
},
popover: {
zIndex: Liferay.zIndex.TOOLTIP
},
trigger: '#<%= nameId %>'
}
);
datePicker.getDate = function() {
var instance = this;
var container = instance.get('container');
return new Date(container.one('#<%= yearParamId %>').val(), container.one('#<%= monthParamId %>').val(), container.one('#<%= dayParamId %>').val());
};
return datePicker;
}
);
Liferay.component('<%= nameId %>DatePicker');