[英]Set default time in wickedpicker
我目前正在使用wickedpicker。 當用戶執行按鈕單擊操作時,我需要將默認時間設置為兩個wickedpicker控件。 timepickers.wickedpicker('time',1)返回時間,但它不提供任何設置時間的方法。
你能告訴我,我怎么能做到這一點?
您可以重新實例化。
以下是選項:-
var options = {
now: "12:35", //hh:mm 24 hour format only, defaults to current time
twentyFour: false, //Display 24 hour format, defaults to false
upArrow: 'wickedpicker__controls__control-up', //The up arrow class selector to use, for custom CSS
downArrow: 'wickedpicker__controls__control-down', //The down arrow class selector to use, for custom CSS
close: 'wickedpicker__close', //The close class selector to use, for custom CSS
hoverState: 'hover-state', //The hover state class to use, for custom CSS
title: 'Timepicker', //The Wickedpicker's title,
showSeconds: false, //Whether or not to show seconds,
secondsInterval: 1, //Change interval for seconds, defaults to 1,
minutesInterval: 1, //Change interval for minutes, defaults to 1
beforeShow: null, //A function to be called before the Wickedpicker is shown
show: null, //A function to be called when the Wickedpicker is shown
clearable: false, //Make the picker's input clearable (has clickable "x")
};
$('.timepicker').wickedpicker(options);
因此,在您的按鈕中click
,請致電:-
$('button').click(function(){
$('.timepicker').wickedpicker({ now: "12:35" });
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.