Subscribe onscroll
by kompiajaib
HTML
<button onclick="eraseCookie('hideDialog');">Hapus Kuki</button>
<script>
var appended = false,
bookmark = document.createElement("div");
bookmark.id = "subscribeOnscroll";
bookmark.innerHTML = '<div class="subscribe_box2 slideInUp">\
<div id="subscribe-box2">\
<p class="subs-title">SUBSCRIBE <span class="subs-title2">to Our Newsletter</span></p>\
<p>Sign up here with your email address to receive updates from this blog in your inbox.</p>\
<div class="emailfield">\
<form action="//feedburner.google.com/fb/a/mailverify" method="post" onsubmit="window.open('//feedburner.google.com/fb/a/mailverify?uri=KompiAjaib', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true" target="popupwindow">\
<span class="form-name">\
<input name="name" onblur="if (this.value == "") {this.value = "Your Name";}" onfocus="if (this.value == "Your Name") {this.value = "";}" type="text" value="Your Name"/></span>\
<span class="clear"></span>\
<span class="form-email">\
<input name="email" onblur="if (this.value == "") {this.value = "Your Email";}" onfocus="if (this.value == "Your Email") {this.value = "";}" type="text" value="Your Email"/></span>\
<input name="uri" type="hidden" value="KompiAjaib"/>\
<input name="loc" type="hidden" value="en_US"/>\
<span class="form-button">\
<input class="submitbutton" type="submit" onclick="hidesubscribebox()" value="Subscribe Now!"/></span>\
</form>\
</div>\
</div>\
<div class="close-shareOnscroll" onclick="hidesubscribe()">×</div>\
</div>\
';
function hidesubscribe() {
document.getElementById("subscribeOnscroll").style.display = "none"
}
function hidesubscribebox() {
...
CSS
body {
height: 8000px
}
.subscribe_box2 {
width: 400px;
margin: 0;
padding: 0;
position: fixed;
right: 0;
bottom: 0;
}
#subscribe-box2 {
width: 100%;
height: auto;
background-color: #fff;
-webkit-box-shadow: 0px 10px 50px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 10px 50px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 10px 50px 0px rgba(0, 0, 0, 0.25);
margin: 0;
padding: 10px 0;
border: 1px solid #dedede;
border-right: 0;
border-bottom: 0;
border-radius: 5px 0 0 0
}
#subscribe-box2 p {
font-size: 18px;
color: #666;
font-weight: 300;
text-align: center;
line-height: 20px;
padding: 10px 20px 0;
margin: 0
}
#subscribe-box2 .emailfield {
padding: 0 20px 10px
}
#subscribe-box2 .emailfield input {
color: #777;
padding: 10px 10px 10px 30px;
margin-top: 10px;
font-size: 15px;
font-weight: 300;
width: 100%;
background: #ebebeb;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: rgba(0, 0, 0, 0.247059) 0px 1px 3px inset, #f5f5f5 0px 1px 0px;
box-shadow: rgba(0, 0, 0, 0.247059) 0px 1px 3px inset, #f5f5f5 0px 1px 0px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box
}
#subscribe-box2 .emailfield input:focus {
outline: 0;
background: #f5f5f5
}
#subscribe-box2 .emailfield .submitbutton {
background: #F4836A;
box-shadow: 0 4px 0 0 #cb5940;
color: #fff!important;
border: none;
font-weight: 500;
outline: 0;
width: 100%;
cursor: pointer;
transition: all 400ms ease-in-out;
}
#subscribe-box2 .emailfield .submitbutton:hover,
#subscribe-box2 .emailfield .submitbutton:active {
background: #fb6f50!important
}
#subscribe-box2 .subs-title {
font-family: Roboto, sans-serif;
font-weight: 900!important;
color: #333!important;
font-size: 24px!important
}
#subscribe-box2 .subs-title2 {
font-family: Georgia, sans-serif;
font-style: italic;
font-weight: 400!important
}
#subscribe-box2 .form-name,
#subscribe-box2...