jQuery:修改输入的结构

发布于 2024-09-28 03:41:03 字数 635 浏览 2 评论 0原文

我今天写这篇文章是因为我需要一些 jquery 中简单函数的帮助来修改输入 [reCaptcha] 的结构并隐藏显示的图像。

包含 reCaptcha 插件的页面代码为:

http://pastebin.com/Qahph2ZB

可以在 Jquery 中实现吗?

前 - - - - - - - - - - - - - - - - - - - - - - - - - -----------> 之后

之前 > AFTER

(因为我看过一个脚本的视频[用 Js/Jquery 制作] 可以实现这种效果:-(

我已经尝试过,但什么也没有:-(

PS:我无法修改页面的原始结构:-( ...我想用 Greasemonkey 注入 Jquery。

提前致谢。

亲切的问候

Luca。

i have wrote today because i need some help with a simple function in jquery for modify the structure of an input [reCaptcha] and hide the image showed.

The code of the page(s) that contains the reCaptcha plugin is:

http://pastebin.com/Qahph2ZB

Is possible to make this in Jquery?

BEFORE ------------------------------------------------------------> AFTER

BEFORE > AFTER

(Because i have saw a video of a script[Made in Js/Jquery] that make this effect :-(

I have tryed but nothing :-(

P.S: I can't modify the original structure of the page :-( ... I would like to inject the Jquery with Greasemonkey.

Thanks in advance.

Kind Regards

Luca.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

油饼 2024-10-05 03:41:03

您可以使用 CSS 将 DIV 元素放置在文本和验证码的输入区域上吗?

在此处查看完整的源代码: http://gist.github.com/632560

如果您修改代码(我使用的是第 1 页中的代码)到以下内容:

<div id="DivCaptcha">
    <!-- <span class="Instructions" id="Instructions">Fill the captcha.</span> -->
    <span class="Instructions" id="Instructions">Fill the captcha.</span>
    <form onsubmit="return submit();" action="">
    <div id="captcha-container">
        <script type='text/javascript'> var RecaptchaOptions = { theme : 'white' }; </script> <script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LfF970SAAAAAFR6KJNsdJX6Itf43k_HWbxRcU4a "></script>
        <noscript>
            <iframe src="http://api.recaptcha.net/noscript?k=6LfF970SAAAAAFR6KJNsdJX6Itf43k_HWbxRcU4a " height="300" width="500" frameborder="0"></iframe><br/>
            <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
            <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
        </noscript>       
        <div id="cover-captcha">
        </div>      
        <div id="cover-input">
        </div>
    </div>
    <input type="submit" id="submit" value="Submit!">
</div>

然后将以下 CSS 添加到您的页面:

#captcha-container {
    position:relative;
}
#cover-captcha {
    position:absolute;
    top:10px;
    left:10px;
    width:295px;
    height:55px;
    z-index:9999;
    background-color:#fff;
}
#cover-input {
    position:absolute;
    top:96px;
    left:26px;
    width:150px;
    height:20px;
    z-index:9999;
    background-color:#fff;
}

它将覆盖您想要覆盖的元素。然后,您可以在需要时使用 jQuery 显示/隐藏这些元素,如下所示:

<input type="button" id="show-hide" value="Show/Hide Captcha fields"/>
<script>
    $("#show-hide").click(function(e){
        $("#cover-captcha, #cover-input").toggle();
    });
</script>

编辑: 响应您的评论.. 试试这个:

$("#recaptcha_response_field").hide();
$("#recaptcha_image").hide();

You could use CSS to place DIV elements over the text and the input area of the captcha?

Check out the complete source here: http://gist.github.com/632560

If you modify your code (I am using the code from page 1) to the following:

<div id="DivCaptcha">
    <!-- <span class="Instructions" id="Instructions">Fill the captcha.</span> -->
    <span class="Instructions" id="Instructions">Fill the captcha.</span>
    <form onsubmit="return submit();" action="">
    <div id="captcha-container">
        <script type='text/javascript'> var RecaptchaOptions = { theme : 'white' }; </script> <script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LfF970SAAAAAFR6KJNsdJX6Itf43k_HWbxRcU4a "></script>
        <noscript>
            <iframe src="http://api.recaptcha.net/noscript?k=6LfF970SAAAAAFR6KJNsdJX6Itf43k_HWbxRcU4a " height="300" width="500" frameborder="0"></iframe><br/>
            <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
            <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
        </noscript>       
        <div id="cover-captcha">
        </div>      
        <div id="cover-input">
        </div>
    </div>
    <input type="submit" id="submit" value="Submit!">
</div>

And then you add the following CSS to your page:

#captcha-container {
    position:relative;
}
#cover-captcha {
    position:absolute;
    top:10px;
    left:10px;
    width:295px;
    height:55px;
    z-index:9999;
    background-color:#fff;
}
#cover-input {
    position:absolute;
    top:96px;
    left:26px;
    width:150px;
    height:20px;
    z-index:9999;
    background-color:#fff;
}

It will cover the elements you want covered. You can then use jQuery to show/hide these elements when you want like so:

<input type="button" id="show-hide" value="Show/Hide Captcha fields"/>
<script>
    $("#show-hide").click(function(e){
        $("#cover-captcha, #cover-input").toggle();
    });
</script>

EDIT: In response to your comment.. Try this:

$("#recaptcha_response_field").hide();
$("#recaptcha_image").hide();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文