javascript - 按下按钮,出现加载弹出窗口,然后更改弹出文本

标签 javascript jquery html css popup

我有一个按钮,当有人点击它时,我希望弹出一个框(我已经实现了),但在弹出之前我想要某种带有文本的加载圆圈,并且在 3 后弹出秒。

这可能吗?

当前代码:

<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">
<div class="btn">Win!</div>
</a>
<div id="light" class="white_content">Congratulations, you've won!<br>Claim your prize now by completing a short survey:<br>
<input type="submit" value="Complete Survey" onclick="location.href='http://mobverify.com/cl.php?id=5c78fd59851bf0c4867c008c9882d808'"> 
<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"></a>
</div>

弹出窗口的样式:

.white_content {
        display: none;
        position: absolute;
        top: 25%;
        left: 25%;
        width: 50%;
        height: 150%;
        padding: 16px;
        border: 2px solid white;
        background-color: #2e3141;
        z-index:1002;
        overflow: auto;
        text-align: center;
        color: white;
        border-radius: 30px;
    }

最佳答案

只需将以下 CSS 添加到您的代码中即可。 CSS:-

.btn {
   width: 316px;
   height: 316px;
}
.btn:active{  background:url(http://www.cuisson.co.uk/templates/cuisson/supersize/slideshow/img/progress.BAK-FOURTH.gif) no-repeat; 
}

关于javascript - 按下按钮,出现加载弹出窗口,然后更改弹出文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34412145/

相关文章:

javascript - 如何让这个 jQuery 文本消失?

javascript - Jquery 缩放不起作用

java - 传递参数 - 使用 Javascript 将 Python 转换为 HTML

javascript - 为什么 jQuery(document).on('click... 不注册对特定 div 的点击?

javascript - 使用 lodash 将键/值对转换为对象

javascript - 如何在 Parse.com SDK 中循环创建多个对象?

javascript - AngularJS ng-重复嵌套 JSON 数据

html - 单击按钮时Vuejs重定向到url

html - 当显示多个文本行时,如何对齐内联 block 样式的 div 元素?

javascript - 如何通过删除 "#"使 Angular URL 变得更清晰?