Use html to implement an example code for a button with click (show, hide) effects

零下一度
Release: 2017-05-03 16:50:26
Original
7111 people have browsed it

A share button, a hidden picture (this picture is absolutely positioned in the upper right corner), then click to show, click to hide.

<a href="javascript:;" onclick="document.getElementById(&#39;mcover&#39;).style.display=&#39;block&#39;;">分享到朋友圈</a>
<div id="mcover" onclick="document.getElementById(&#39;mcover&#39;).style.display=&#39;&#39;;" 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;
}
Copy after login

The above is the detailed content of Use html to implement an example code for a button with click (show, hide) effects. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!