Skip to content

Instantly share code, notes, and snippets.

@jramsahai
Created March 23, 2017 16:13
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 jramsahai/dc4a368eff63f92bccfea2214de50358 to your computer and use it in GitHub Desktop.
Save jramsahai/dc4a368eff63f92bccfea2214de50358 to your computer and use it in GitHub Desktop.
Button Selector
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><script>
$(function() {
$("#feedback_yes").click(function() {
$("#feedback_buttons").hide();
$("#feedback_text").hide();
$("#feedback_response").show();
$("#feedback_response").html("We're happy to help!");
setTimeout(function() { API.closeCta({ disablePlay: true }); }, 3000);
});
$("#feedback_no").click(function() {
$("#feedback_buttons").hide();
$("#feedback_text").hide();
$("#feedback_response").show();
$("#feedback_response").html("Sorry to hear that.<br>Someone will be back in touch.");
setTimeout(function() { API.closeCta({ disablePlay: true }); }, 3000);
});
});
</script><style type="text/css">.feedback-ticket {
position: relative;
max-width: 600px;
margin: 0 auto;
text-align: center;
}
.feedback-ticket h3 {
color: #fff;
}
.feedback-ticket span button {
margin: 0 20px;
padding: 10px 20px;
text-align: center;
background-color: #61c661;
border: 1.5px solid #4ebf4e;
border-radius: 2px;
color: #fff;
box-shadow: 0 1.5px rgba(0,0,0,0.15);
cursor: pointer;
}
.feedback-ticket span button:hover {
background-color: #3da93d;
border-color: #369636;
}
.feedback-response {
margin-top: 40px;
}</style><div class="feedback-ticket"><h3 id="feedback_text">Did this video resolve your issue?</h3><span id="feedback_buttons"><button id="feedback_yes">Yes</button><button id="feedback_no">No</button></span><h3 id="feedback_response" class="feedback-response" hidden=""> </h3></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment