zoukankan      html  css  js  c++  java
  • Jquery tabs

    官网
    http://api.jqueryui.com/tabs/


    必须通过了后台验证tab1的信息后才允许进入tab2

            var passed=false;
             $("#tabs").tabs({
                event: "click",
                active: 0,
                beforeActivate: function (event, ui) {
                    if (ui.newTab.text() == "Tab2") {
                      $('#tabs-1 .validationMsg').hide();
                        var ok = true;
                        if (!passed ) {
                            ok = validate();  //前台validation
                        }

                        var toDo = function () {
                            passed = true;
                            $('#tabs').tabs("option", "active", 1);
                            //$('#tabs ul li:eq(1) a').focus();
                        }

                        var notToDo = function () {
                            passed = false;
                            var errorMsg = $('#tabs-1 .validationMsg').html();
                            // event.preventDefault();
                            // ui.oldTab.focus();
                            $('#tabs').tabs("option", "active", 0);
                            $('#tabs ul li:eq(0) a').focus();
                            setTimeout("$('#tabs-1 .validationMsg').html('" + errorMsg + "');$('#tabs-1 .validationMsg').show();", 0);
                            return;
                        }

                        if (!ok) {
                            event.preventDefault();
                            notToDo();
                        }
                        else {
                            if (!passed) {
                                validate2($('#tabs-1'), '/controller/action', toDo, notToDo);  //后台ajax验证
                                event.preventDefault();
                            }
                        }

                    }
                }
            });


     

  • 相关阅读:
    How to convert VirtualBox vdi to KVM qcow2
    (OK)(OK) adb -s emulator-5554 shell
    (OK)(OK) using adb with a NAT'ed VM
    (OK) How to access a NAT guest from host with VirtualBox
    (OK) Creating manually one VMs from an existing VDI file in CLI (VBoxManage) in Fedora 23
    (OK)(OK) Creating VMs from an existing VDI file in CLI (VBoxManage) in Fedora 23
    (OK) Creating_VMs_from_an_existing_VDI_file.txt
    (OK) Creating VMs from an existing VDI file —— in OS X
    (OK) install_IBM_SERVER.txt
    (OK) install chrome & busybox in android-x86_64 —— uninstall chrome
  • 原文地址:https://www.cnblogs.com/sui84/p/6777183.html
Copyright © 2011-2022 走看看