.socidropbtn {
border-radius: 4px;
background-color: #008781;
color: black;
margin-top: -9.5px;
padding-top: 10px;
padding-bottom: 14px;
padding-left: 6px;
padding-right: 6px;
font-size: 13px;
border: none;
cursor: pointer;
font-family: helvetica, arial, sans-serif;
font-weight: bold;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
/* Dropdown button on hover & focus */
.socidropbtn:hover,
.socidropbtn:focus {
background-color: #006661;
}
/* The container <div> - needed to position the dropdown content */
.socidropdown {
padding-bottom: -5px;
position: relative;
display: inline-block;
text-align: center;
}
/* Dropdown Content (Hidden by Default) */
.socidropdown-content {
display: none;
position: absolute;
margin-bottom: -10px;
background-color: #d9d9d9;
min-width: 130px;
}
/* Links inside the dropdown */
.socidropdown-content a {
color: black;
padding-bottom: 0px;
margin-bottom: 0px;
/*need to declare padding prior to padding-bottom*/
text-decoration: none;
display: block;
}
/* Change color of dropdown links on hover */
.socidropdown-content a:hover {
background-color: #006661
}
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {
display: block;
}
JavaScript
function myFunc() {
document.getElementById("mysociDropdown").classList.toggle("show");
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.socidropbtn')) {
var i, socidropdowns = document.getElementsByClassName("socidropdown-content");
for (i = 0; i < socidropdowns.length; i++) {
var opensociDropdown = socidropdowns[i];
if (opensociDropdown.classList.contains('show')) {
opensociDropdown.classList.remove('show');
}
}
}
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.