Skip to content

Instantly share code, notes, and snippets.

@outoftime
Created July 14, 2017 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save outoftime/aac9e95c2fcda30df8b74cc60eba19a7 to your computer and use it in GitHub Desktop.
Save outoftime/aac9e95c2fcda30df8b74cc60eba19a7 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: http://localhost:3000/?gist=aac9e95c2fcda30df8b74cc60eba19a7
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<form>
<div class="multiselect">
<div class="selectNotification" onclick="showCheckboxes()">
<select>
<option>Subscribe For Updates</option>
</select>
<div class="overSelect"></div>
</div>
<div id="checkboxes">
<label for="allss">
<input type="checkbox" id="all" name = "test"/>All</label>
<label for="breaker">
<div class="divider"></div></label>
<label for="myPost">
<input type="checkbox" id="myPost" />Replies to my post</label>
<label for="postAdd">
<input type="checkbox" id="postAdd" />When new post are added</label>
<label for="Replied">
<input type="checkbox" id="Replied" />When any post is replied to </label>
</div>
</div>
</form>
<button id="button">test</button>
</body>
</html>
{"enabledLibraries":["jquery"]}
var expanded = false;
var map = false;
function showCheckboxes() {
var checkboxes = document.getElementById("checkboxes");
if (!expanded) {
checkboxes.style.display = "block";
expanded = true;
} else {
checkboxes.style.display = "none";
expanded = false;
}
}
var num =0;
while (num <2){
if (num===0){
$("#button").click(function () {
num+=1;
$('#button').css("color","red");
console.log(num);
});
}
if (num===1){
$("#button").click(function () {
num-=1;
$('#button').css("color","blue");
console.log(num);
});
}
}
.multiselect {
width: 200px;
}
.selectNotification {
position: relative;
}
.selectNotification select {
width: 100%;
font-weight: bold;
}
.overSelect {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
#checkboxes {
display: none;
border: 1px #dadada solid;
}
#checkboxes label {
display: block;
}
#checkboxes label:hover {
background-color: #1e90ff;
}
.divider{
width: 198px;
height: 1px;
border-bottom: 1px solid #d3d3d3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment