zoukankan      html  css  js  c++  java
  • input reset 重置时间

    经验规律,301毫秒。

    
    function autoFormatMoney() {
         if (!this.value.length) {return}
         var num = parseFloat(this.value.replace(/,/g, ''));
         if (isNaN(num)) {return}
         var name = this.name;
         if (name === 'paymentValue') {
             this.value = window.format_number(num);
             form.paymentRatio.value = ((num / totalAsset)*100).toFixed(3);
             !triggerFromReset && $(form.paymentRatio).trigger('focus');
         } else if (name === 'paymentRatio') {
             this.value = num.toFixed(3);
             form.paymentValue.value = window.format_number(( num / 100 )* totalAsset);
         } else if(name === 'fees' || name === 'insurance'){
             this.value = window.format_number(num);
         } else if(name === 'rate' || name === 'taxes'){
             this.value = num.toFixed(3);
         }
         triggerFromReset = false;
     }
    
     $(form.homePrice).on('change', autoFormatMoney).trigger('change');
     $(form.paymentValue).on('change', autoFormatMoney).trigger('change');
     $(form.paymentRatio).on('change', autoFormatMoney).trigger('change');
     $(form.fees).on('change', autoFormatMoney).trigger('change');
     $(form.taxes).on('change', autoFormatMoney).trigger('change');
     $(form.rate).on('change', autoFormatMoney).trigger('change');
     $(form.insurance).on('change', autoFormatMoney).trigger('change');
    
     $('.calculator-func_reset').on(Data.CLICK,function(e){
         triggerFromReset = true;
         setTimeout(function() {
             $sindeoCal.find('input').trigger('change');
         }, Data.isMobile?301:10);
     });
    
    
    // input readonly 之后依旧调起输入法 unselectable="on" onfocus="this.blur()"
    $('.slide-figure').on('focus','input',function () {
        if (data.isLogin){
            $(this).attr('unselectable','on');
            $(this).blur();
        }
    });
    

    类似点透

    $('.toggle-show').on(CLICK,function(){
        $('.toggle-text').toggle();
        $('.toggle-icon').toggleClass('icon-up');
        $('.toggle-input').toggle(100);
        $('.m-calc input[name="propertyTaxRate"]').one('focus',function () {
            $(this).blur();
        });
    });
    
  • 相关阅读:
    IOS tableView的数据刷新
    IOS Modal(切换另外控件器方式)
    IOS UITabBarController(控制器)的子控制器
    iOS 应用数据存储的常用方式
    IOS 获取文本焦点 主动召唤出键盘(becomeFirstResponder) and 失去焦点(退下键盘)
    集合类型
    提取URL的搜索字符串中的参数
    本地对象、内置对象、宿主对象
    声明函数 执行上下文 匿名函数
    完善tab页面定位
  • 原文地址:https://www.cnblogs.com/lakeInHeart/p/7815890.html
Copyright © 2011-2022 走看看