zoukankan      html  css  js  c++  java
  • 无题

        <script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            function showDiv(ids) {
                var dis = $("#" + ids).attr("dis");
                var div = $("#div" + dis);
                var towhere = $("#"+ids).attr("jj");
                if (div.is(":visible")) {
                    div.hide();
                }
                else {
                    div.show();
                }
                //bind events
                if (!div.data("hasbind")) {
                    div.find(":checkbox").click(function () {
                        var txt = $(this).next().text();
                        if (txt == "任意") {
                            div.find(":checkbox").slice(1).attr("checked", false);
                            div.find(":checkbox:first").attr("checked", true);
                            $("#" + towhere).val($(this).attr("checked") ? txt : "");
                            return;
                        }
                        else if (div.find(":checkbox:checked").length == div.find(":checkbox").length - 1) {
                            div.find(":checkbox").slice(1).attr("checked", false);
                            div.find(":checkbox:first").attr("checked", true);
                            $("#" + towhere).val("任意");
                            return;
                        }
                        else {
                            div.find(":checkbox:first").attr("checked", false);
                        }
                        var arr = [];
                        div.find(":checkbox:checked").each(function () {
                            arr.push($(this).next().text());
                        });
                        $("#" + towhere).val(arr.join(','));
                    });
                    div.data("hasbind", true);
                }
            }
            $(document).ready(function () {
                //            $("#marriage_con").click(function () {
                //                var dis = $(this).attr("dis");
                //                var div = $("#div" + dis);
                //                var towhere = $(this).attr("jj");
                //                if (div.is(":visible")) {
                //                    div.hide();
                //                }
                //                else {
                //                    div.show();
                //                }
                //                //bind events
                //                if (!div.data("hasbind")) {
                //                    div.find(":checkbox").click(function () {
                //                        var txt = $(this).next().text();
                //                        if (txt == "任意") {
                //                            div.find(":checkbox").slice(1).attr("checked", false);
                //                            $("#" + towhere).val($(this).attr("checked") ? txt : "");
                //                            return;
                //                        }
                //                        else if (div.find(":checkbox:checked").length == div.find(":checkbox").length - 1) {
                //                            div.find(":checkbox").slice(1).attr("checked", false);
                //                            div.find(":checkbox:first").attr("checked", true);
                //                            $("#" + towhere).val("任意");
                //                            return;
                //                        }
                //                        else {
                //                            div.find(":checkbox:first").attr("checked", false);
                //                        }

                //                        var arr = [];
                //                        div.find(":checkbox:checked").each(function () {
                //                            arr.push($(this).next().text());
                //                        });
                //                        $("#" + towhere).val(arr.join(','));
                //                    });
                //                    div.data("hasbind", true);
                //                }
                //            });
            });
          
        </script>

  • 相关阅读:
    用orgmode写加密日记
    用emacs加密文件(使用ccrypt)
    C#使用注册表添加删除开机启动项
    WPF中使用第三方字体选择器
    使用rdesktop远程连接Windows桌面
    webbrowser 提交按钮没反应的问题解决办法
    C#中webBrowser加载页面中的不同域的iFrame的源代码的取得
    C# 天涯博客验证码识别(转)
    webbroser 清除COOKIES的解决办法
    使用C#实现ADSL自动拨号
  • 原文地址:https://www.cnblogs.com/caishuowen/p/2121990.html
Copyright © 2011-2022 走看看