如何在单击按钮时弹出窗口?

问题描述 投票:0回答:2

所以基本上我的目标是编写自己的ReCaptcha。为了实现这一点,我希望在单击按钮发送表格或类似内容时出现一个窗口。最好的情况是like this,但里面有我自己的内容。是否可以仅使用一个js脚本或添加几个div来做到这一点?

javascript html css recaptcha
2个回答
0
投票

您可以创建一个div,然后在click事件中调整其大小。 Codepen

<style>
    #captcha{
        background-color:powderblue;
        width:80px;
        height:80px;
    }
</style>
<div id="captcha">
    Click this captcha!
</div>
<script>
    document.getElementById("captcha").addEventListener("click",function(){
        this.style.width = "200px";
    }
</script>

0
投票

我认为您可以使用jquery模态。

检查以下链接https://jquerymodal.com/

官方文档可以在以下位置找到

https://jqueryui.com/dialog/

© www.soinside.com 2019 - 2024. All rights reserved.