zoukankan      html  css  js  c++  java
  • 设置点击文本框或图片弹出日历控件

    <input id="startDate" value="" readonly="true"  type="text" style="cursor: pointer" class="user_datepicker ">
    <input class="canlderImg" data-tag="start" type="image" src="../../i/canlder1.png">
    <span>结束:</span>
    <input id="endDate" value="" readonly="true" type="text" style="cursor:pointer;" class="user_datepicker">
    <input class="canlderImg" data-tag="end" type="image" src="../../i/canlder1.png" >


    //js代码
    $("#startDate").datepicker();

    $("#endDate").datepicker();
    //点击图片弹出日历控件则需要给图片绑定点击事件
    $(.canlderImg).on("click",function(e){
    var tag=$(e.target).attr("data-tag");
    if(tag=="start"){
    $("#startDate").datepicker( "show" );
    }else if(tag=="end"){
    $("#endDate").datepicker( "show" );
    }
    });
  • 相关阅读:
    Socket通信
    浏览器调用打印机
    python dict操作
    python list操作
    python 模块Example链接
    python random模块
    python configparser模块
    python unittest模块
    python timeit模块
    python datetime模块
  • 原文地址:https://www.cnblogs.com/wangying731/p/5481239.html
Copyright © 2011-2022 走看看