fancybox для регулировки по центру - PullRequest
0 голосов
/ 22 ноября 2011

у меня есть следующий код

для необычного кода коробки и логина

$("a#loginID").fancybox({

        'onClosed'      : function() {
        $("#login_error").empty();$("#login_error").hide();
    }
});

// for controlling tab

    // When a link is clicked
        $("a.tab").click(function () {


            // switch all tabs off
            $(".active").removeClass("active");

            // switch this tab on
            $(this).addClass("active");

            // slide all content up
            $(".content").slideUp();

            // slide this content up
            var content_show = $(this).attr("title");
            $("#"+content_show).slideDown();

        });

    $('.default-value').each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
            $(this).removeClass("onblur").addClass("onfocus");

        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
            $(this).removeClass("onfocus").addClass("onblur");
        }
    });
});

html

<div style="display:none;">
    <div id="popUpLogin" style="width:400px;overflow:auto;">
<div id="tabbed_box_1" class="tabbed_box">
    <h4>&nbsp;Wears It Best <small>Select a Tab to login or register</small></h4>
    <div class="tabbed_area">


        <ul class="tabs">
            <li><a href="#" title="content_1" class="tab active">Register</a></li>
            <li><a href="#" title="content_2" class="tab">Sign In</a></li>


        </ul>

        <div id="content_1" class="content">
            <form id="form1" name="form1" method="post" action=""><table width="368" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td width="368"><strong>Name</strong></td>
  </tr>
  <tr>
    <td><input id="registration-title" name="title" title="Title" class="default-value onblur"   maxlength="30" type="text" value="Title"/></td>
  </tr>
  <tr>
    <td>
<input id="registration-firstName" name="firstName" title="First name" class="default-value onblur"  maxlength="100" type="text" value="First name" />
      <input id="registration-lastName" name="lastName" title="Last name" class="default-value onblur"   maxlength="100" type="text" value="Last name"/></td>
  </tr>
  <tr>
    <td><strong>Email</strong></td>
  </tr>
  <tr>
    <td><input id="registration-email" name="registration-email" value="" maxlength="200" type="text" /></td>
  </tr>
  <tr>
    <td><strong>Password</strong> (at least 6 characters)</td>
  </tr>
  <tr>
    <td><input id="registration-password1" name="password1" value="" maxlength="50" type="password" /></td>
  </tr>
  <tr>
    <td><strong>Password</strong> <strong>Confirmation</strong></td>
  </tr>
  <tr>
    <td><input id="registration-password2" name="password2" value="" maxlength="50" type="password" /></td>
  </tr>
  <tr>
    <td><label id="label-consentforcontact" for="consentForContact">
      <input type="checkbox" name="contactme" id="contactme" />
      Wears It Best can contact me with relevant updates, offers and news</label></td>
  </tr>
  <tr>
    <td>By clicking Create Account you confirm that you agree to our website <a target="_blank" onclick="" href="#">terms of use</a>and our <a target="_blank" onclick="" href="#">privacy policy</a>.</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><input id="create-account-button" name="register" value="Create Account" type="submit" /></td>
  </tr>
            </table>


  </form>
        </div>
    <div id="content_2"  class="content">

            <form id="loginform" name="loginform" method="post" action=""><table width="368" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td colspan="2"><div id="login_error" style="display:none;"> Please enter email or password!!!</div><strong>Email</strong><input name="signin" type="hidden" id="signin" value="signin" /></td>

  </tr>
  <tr>
    <td colspan="2"><input type="text" name="email" id="email" /></td>
    </tr>
  <tr>
    <td><strong>Password</strong></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2"><input type="password" name="pword" id="pword" /></td>
    </tr>
  <tr>
    <td colspan="2"><input type="submit"   id="login" name="login" value="Sign In" /></td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

</form>
        </div>


    </div>

</div>
</div>
</div>

все работает нормально, сначала вызывается вкладка регистрации икогда пользователь пытается войти в систему и терпит неудачу ... он выводит требуемое сообщение ... но если пользователи закрывают fancybox и открывают снова ... вкладка по-прежнему настроена на вкладку входа, а fancybox настроена насередина такова, что если человек нажимает на кнопку «Зарегистрировать», то окно с надписью «fancybox» не корректируется вверх, чтобы вместить регистрационную форму .... что я могу сделать, чтобы это исправить?

...