jquery tab切换

        <div class="login_nav" id="login">
            <div class="loginFunc">
                <div class="loginFuncDynPw">小说城</div>
                <div class="loginFuncNormal">军婚小说</div>
            </div>
            <div class="loginForm">
                <form method="post" action="#" onsubmit="return Dcheck();">
                    <div style="padding-top:50px;padding-left:25px;">
                        <a href="https://open.weixin.qq.com"><img src="/cwq/img/wxdl.png"/></a>
                    </div>
                </form>
            </div>
            <div class="loginForm" style="display:none;">
                <form method="post" action="#" onsubmit="return Dcheck();">
                    <input name="forward" id="forward" value="http://www.xiaoshuocity.com/member/" type="hidden">

                    <div class="loginFormIpt showPlaceholder">
                        <b class="ico ico-uid"></b>
                        <input class="formIpt" tabindex="1" title="请输入帐号" name="username" id="username" maxlength="50"
                               autocomplete="off" type="text">
                    </div>
                    <!-- 普通密码登录 -->
                    <div id="pwdInputLine" class="loginFormIpt showPlaceholder">
                        <b class="ico ico-pwd"></b>
                        <input class="formIpt" tabindex="2" title="请输入密码" id="password" name="password" type="password">
                    </div>
                    <!-- 普通密码登录 -->
                    <div class="clear"></div>
                    <div id="normalLogin" style="display: block;">
                        <div class="loginFormCheck">
                            <div id="lfAutoLogin" class="loginFormCheckInner">

                                <label class="label_left" title="选中后 一月内不用再次登录 网吧或公共计算机请勿选">
                                    <input name="cookietime" value="1" id="cookietime" checked="checked"
                                           type="checkbox"><label for="cookietime">记住用户名</label></label>
                            </div>

                        </div>
                        <div class="loginFormBtn">
                            <input class="login_btn btn-main btn-login" name="submit" value=" 登 录 " type="submit">
                            <a id="lfBtnReg" class="login_btn btn-side btn-reg"
                               href="#"
                               target="_blank">立即注册</a>
                        </div>
                    </div>
                    <!-- 动态密码登录 -->
                </form>

            </div>
            <div class="lophone">
                <%--<script src="js/phone.js"></script>--%>
                <span style="font-weight:bold; color:#ff0000;">4006-876-308</span></div>
        </div>

        <script language="javascript">
            $('.loginFunc div').click(function() {
                var i = $('.loginFunc div').index(this);
                if (i == 1) {
                    $("#login").addClass("tab-2");
                }
                else {
                    $("#login").removeClass("tab-2");
                }
                $(".loginForm").hide().eq(i).show();
            })
            ;
        </script>


效果:

jquery tab切换

jquery tab切换

你可能感兴趣的:(jquery)