zoukankan      html  css  js  c++  java
  • Layui 总结(3)laydate 日期插件 添加选择范围

    开发思路
       1.在要添加地方 给 test1 添加点击事件  当 点击的前提条件发生 再发生如下事情
       2. 在DOM元素 before 或者after 添加dom
       3. 添加dom之后 给dom设计点击事件  模拟用户点击           

     

       $("#test1").click(function () {
          if (!$("#shangxun")[0]) {
            $(".laydate-btns-clear").before('<span class="laydate-btns-clear " id="shangxun" style="margin-right:20px">上旬</span>')
            $(".laydate-btns-clear:eq(0)").after('<span class="laydate-btns-clear " id="zhongxun" style="margin-right:20px">中旬</span>')
            $(".laydate-btns-clear:eq(1)").after('<span class="laydate-btns-clear " id="xiaxun" style="margin-right:200px">下旬</span>')
            
            $("#shangxun").click(function () {
              $(".layui-laydate-content td:not(.laydate-day-prev):eq(0)").click();
              $(".layui-laydate-content td:not(.laydate-day-prev):eq(9)").click();
            })
            $("#zhongxun").click(function () {
              $(".layui-laydate-content td:not(.laydate-day-prev):eq(10)").click();
              $(".layui-laydate-content td:not(.laydate-day-prev):eq(19)").click();
            })
            $("#xiaxun").click(function () {
              $(".layui-laydate-content td:not(.laydate-day-prev):eq(20)").click();
              $(".laydate-day-next:first").prev().click();
              console.log($(".laydate-day-next:first").prev())
            })
            
          }
        })
    

      

  • 相关阅读:
    三、MyCat主要配置介绍
    二、mycat15种分片规则
    一、mycat介绍
    SpringBoot使用JdbcTemplate批量保存
    linux发布常用命令
    ROS 系统架构及概念
    ROS 在 Ubuntu 18.04 安装
    利用 Skywalking 搭建 APM(应用性能管理)— 安装与配置
    elasticsearch 集群搭建及启动常见错误
    Git 基本操作
  • 原文地址:https://www.cnblogs.com/nice2018/p/10854936.html
Copyright © 2011-2022 走看看