时间:2021-07-01 10:21:17 帮助过:322人阅读
- <a href="javascript:;" onclick="document.getElementById('mcover').style.display='block';">分享到朋友圈</a>
- <div id="mcover" onclick="document.getElementById('mcover').style.display='';" style="display: none;">
- <img src="/public/images/guide.png">
- </div>
- 对应样式如下:
- #mcover {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.7);
- display: none;
- z-index: 20000;
- }
- #mcover img {
- position: fixed;
- right: 18px;
- top: 5px;
- width: 260px;
- height: 180px;
- z-index: 999;
- }
以上就是利用html实现一个有点击(显示、隐藏)效果按钮的实例代码的详细内容,更多请关注Gxl网其它相关文章!