• Hey Guys,

    I’m basically looking for a way to hide emails and contact numbers from my site unless a user clicks a “show” button.

    I’ve been searching for a while and it seems like a simple concept but I cant find any plugin that will do the trick.

    Idealy it would be nice if the plugin could pick up the contact/email from a custom field or something fancy, but I dont know how to do that.

    This is really simple js that does exactly what I need, but how do I go about turning this into a plugin, or using it on the site?

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jazzygeoff

    (@jazzygeoff)

    <html>
    <style type="text/css">
    div {display: none;}
    </style>
    <script language="JavaScript">
    function setVisibility(id, visibility) {
    document.getElementById(id).style.display = visibility;
    }
    </script>
    </head>
    <body >
    
    <input type=button name=type value='Show Contact Details' onclick="setVisibility('sub3', 'inline');";>
    
    <div id="sub3">Phone Number: 1023 Email: [email protected]</div>
    </body>
    </html>
    Thread Starter jazzygeoff

    (@jazzygeoff)

    Anybody?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show/Hide on click’ is closed to new replies.