0

我们在旧的旧站点上为登录表单提供了这个 Fancybox 覆盖。我没有建立这个网站,但我试图理解它。我添加了一个指向人们可以注册的新“注册”页面的链接(在代码的底部)。

我在这个网站上检查了许多其他线程,它们似乎应该与此相关,但我还不能通过使用它们来解决我的问题。只是想让大家知道我在发帖前至少进行了搜索。

到目前为止,我已经尝试过:

  • 简单的锚链接
  • 带有 javascript 重定向、位置等的锚点

似乎没有任何效果。我总是收到这个错误:

无法加载请求的内容。请稍后再试。

对此我失去了理智。如此简单的事情(链接到另一个页面)不应该那么困难。

所谓模态的标记:

<a style="float:right;<?= preg_match("/MSIE 7/",$_SERVER['HTTP_USER_AGENT']) ? 'width:135px;' : '' ?>position:relative;top:-3px;left:8px;" href="#login" class="button modal"><span class="begin"></span>Client Login<span class="end"></span></a>

模态标记:

<div id="login" class="modal">

    <form id="login" method="post" action="http://myposturl/">

        <h3>Enter your user name and password to login:</h3>

        <fieldset class="fields">

            <p><label for="username">Username:</label> <span class="field"><input type="text" id="username" name="username" tabindex="1" class="required" /></span></p>

            <p><label for="password">Password:</label> <span class="field"><input type="password" id="password" name="password" tabindex="2" class="required" /></span></p>

            <div class="clear"></div>

            <p><a class="button" href="#submit" onclick="document.forms['login'].submit();" onkeypress="document.forms['login'].submit();" title="Login"><span class="begin"></span>Login<span class="end"></span></a>

                <a href="javascript:;" class="button" onclick="$.fancybox.close();"><span class="begin"></span>Cancel<span class="end"></span></a></p>

        </fieldset>

    </form>

    <p><a href="http://myregistrationurl/">New User? Register here!</a></p>

</div>

下面是实际调用 Fancybox 的代码:

<script type="text/javascript">
    $(document).ready(function() {
        $("a[href*=http://]:not('.facebook_link'),a[href*=https://]:not('.facebook_link')").fancybox({
            'transitionIn' : 'fade', 
            'transitionOut' : 'fade', 
            'height' : '100%', 
            'width' : 900, 
            'speedIn' : 300, 
            'speedOut' : 0, 
            'overlayColor' : '#000'
        });         
        $('a.modal').fancybox({
            'transitionIn' : 'fade', 
            'transitionOut' : 'fade', 
            'speedIn' : 300, 
            'speedOut' : 0, 
            'overlayColor' : '#000',
            'titleShow' : false
        });
        $('.cycle').cycle({
            fx: 'fade',
            pause: true
        });
    });
</script>
4

0 回答 0