基于Jquery实现一个cron表达式选择器

本文介绍了一个基于Jquery实现的cron表达式选择器。通过初始化HTML、时间类型切换事件、时间选择类型互斥事件等功能,该选择器能够帮助用户方便地配置和获取cron表达式的值。代码中包括了获取不同时间类型(如周期、指定时间)的值,以及处理日/周的本地化。最后,选择器的初始化和事件处理函数确保了交互的正确性和灵活性。
摘要由CSDN通过智能技术生成

for(var i= 0;i<timeTypes.length;i++){

renderPeriodHtml(timeTypes[i]);

renderAssignHtml(timeTypes[i]);

}

};

//初始化html

var renderHtml = function(){

var tabItemContainer = renderTabHtml(container);

renderTimeItemHtml(tabItemContainer);

};

//初始化时间类型切换事件

var initTabChooseEvent = function(){

$(‘[tabcode]’).click(function(){

var code = $(this).attr(‘tabcode’);

$(this).addClass(‘active’).siblings().removeClass(‘active’);

$(‘div[tabitemcode=’ + code + ‘]’).show().siblings().hide();

});

};

//清空该时间类型下的所有输入

var clearInput = function(timeType){

var timeContainer = getTimeItemContainer(timeType);

timeContainer.find(“input”).prop(“checked”, false);

};

//初始化时间选择类型互斥事件

var initMutualEvent = function(){

$(‘div[tabItemCode]’,container).each(function(){

var _this = $(this);

var timeType = $(this).attr(‘tabItemCode’);

$(‘input.’+typeSelectorClass,_this).on(‘change’,function(){

if($(this).prop(‘checked’)) {

( ′ i n p u t . ′ + t y p e S e l e c t o r C l a s s , t h i s ) . n o t ( ('input.'+typeSelectorClass,_this).not(

  • 19
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值