如何获取触发弹出窗口的javascript代码?

时间:2013-02-26 23:15:40

标签: javascript jquery-ui jquery javascript-events

我正在尝试为我的项目实现模态弹出,我在jsfiddle中找到了我想要的东西。我可以找出他们用于模态的html和css是什么,但我不知道他们使用的是什么?

你能告诉我他们用于模态的javascript是什么吗?那是当我点击登录按钮时,模态弹出窗口打开

http://jsfiddle.net/VSsLC/

http://jsfiddle.net/VSsLC/embedded/result/

以下是html代码

<div class="modal hide fade" id="login-modal" style="display: none;">
    <a class="close" data-dismiss="modal">×</a>
    <h1>Log in to Kippt</h1>

    <form class="connect-button" name="login" method="post" action="/social/twitter/redirect/" id="twitter-connect-form">
    <div style="display:none"><input type="hidden" name="csrfmiddlewaretoken" value="MNH48hjwVMrGUWcpNqIt4qa1nko6RWdo"></div>

    <a href="#" onclick="$('#twitter-connect-form').submit(); return false;" class="signup-twitter signup-btn" id="twitter_button"><i></i>Log in with Twitter</a>
    </form>
    <form class="connect-button" name="login" method="post" action="/social/facebook/redirect/" id="facebook-connect-form">
      <div style="display:none"><input type="hidden" name="csrfmiddlewaretoken" value="MNH48hjwVMrGUWcpNqIt4qa1nko6RWdo"></div>

      <a href="#" onclick="$('#facebook-connect-form').submit(); return false;" class="signup-facebook signup-btn" id="facebook_button"><i></i>Log in  with Facebook</a>
      </form>

      <form action="/login" method="POST" autocomplete="off"><div style="display:none"><input type="hidden" name="csrfmiddlewaretoken" value="MNH48hjwVMrGUWcpNqIt4qa1nko6RWdo"></div>

        <fieldset>
            <h5>or with Kippt account</h5>
            <input type="text" placeholder="Username or email" name="username" maxlength="30" id="id_username">
            <input type="password" placeholder="Password" name="password" id="id_password">
            <input type="submit" value="Log in" class="btn">
        </fieldset>
         <a href="/accounts/password/reset/"><span>Forgot password?</span></a> · <a href="/signup/"><span>Sign up to Kippt</span></a>
     </form>
</div>

2 个答案:

答案 0 :(得分:1)

您可以直接发送到https://kippt.com/网站的直接链接,询问他们如何创建他们的注册表单。
很明显,他们的Javascript过于混淆,无法理解任何有用的东西,但我确实看到他们使用 jQuery 。通过做一个小的谷歌搜索,我发现有一个非常相似的效果库叫做 bootstrap modal 。 您必须考虑使用jQuery为自己编写此效果的可能性。

答案 1 :(得分:0)

你的问题不是很清楚,但如果我很清楚,你正在寻找js文件。因此,您可以使用一大堆开发工具(chrome,firefox,safari)访问任何浏览器。例如,在Chrome中,转到开发工具,显示控制台(mac上的cmd +选项+ i),转到resssources / Frames / Scripts,你会找到js文件