zoukankan      html  css  js  c++  java
  • 杂记

    1、在asp.net MVC集成的jquery.validate.js中获取单个表单的验证状态:

    //以Email为例,通过返回true,否则返回false
    $("Email").valid()

    2、Jquery多事件集中写法

    $(document).on("keyup mouseup", "#Email", function () {
           if($(this).valid())
           {
    
           }
    });

     3、监听CSS动画结束

                $("body").on("animationend", ".bigicon", function (d) {
                    if (d.originalEvent.animationName == "mymoverever") {
                        $(this).find(".circle").css("background", "#f6f5f5").css("border", "1px solid #ded7d7");
                        $(this).find(".title i").css("background", "#000");
                        $(this).find(".iconfont").css("color", "#000");
                        $(this).find(".title").css("color", "#000");
                    }
                })

    4、高版本Jquery判断IE及其版本

                if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE", "")) == 9) {
                    $(".main-content").css("height", "27em");
                    $(".bigicon .text").css("opacity", "10");
                }

    5、Jquery判断IE8图片完全加载,需要complete后增加半秒到1秒的延时。

                        var timer = setInterval(function () {
                            if ($(".course-img img")[0].complete) {
                                clearInterval(timer);
                                setTimeout(function () {
                                    var div_height = $(".course-img img").height() - 19;
                                    $(".right-course div").css("height", div_height + "px");
                                }, 500);
                            }
                        }, 10);

     6、Remote验证与ValidateAntiForgeryToken相结合

    //增加__RequestVerificationToken字段,同时将http方法改为Post
    [Remote("CheckEmail", "Register", AdditionalFields = "__RequestVerificationToken", HttpMethod = "Post", ErrorMessage = "该邮箱已被使用,请换一个邮箱重试。")]
  • 相关阅读:
    Linux下配置APUE的编译 报错之后如何处理
    Sed命令的使用详细解释
    Linux下安装xrdp
    CentOS7.1 VNC Server服务配置
    Linux下core文件调试方法
    GDB获取帮助信息
    gdb调试工具学习
    Linux中tftp安装及使用笔记
    CentOS7.3安装Python3.6
    C#语言注释详解
  • 原文地址:https://www.cnblogs.com/superfeeling/p/11082220.html
Copyright © 2011-2022 走看看