-
-
Save chrisdev/24702737f3cd0274be91 to your computer and use it in GitHub Desktop.
Improving the UX of the submit button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UX improvement for Submitt Button | |
----------------------------------- | |
Forked from [Mark Hayes](http://codepen.io/mhayes)'s Pen [qdCAc](http://codepen.io/mhayes/pen/qdCAc/). | |
A [Pen](http://codepen.io/rafibomb/pen/bGszx) by [Rafi Benkual](http://codepen.io/rafibomb) on [CodePen](http://codepen.io/). | |
[License](http://codepen.io/rafibomb/pen/bGszx/license). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button type="Submit" class="button postfix "><span class="button-content">Submit</span></button> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('button').on('click', function(event){ | |
event.preventDefault(); | |
$(this) | |
.blur() | |
.addClass('is-submitted') | |
.find('.button-content') | |
.text('Got it, thanks!'); | |
}); | |
$(document).foundation(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
button:active, | |
button.is-submitted, | |
button.is-submitted:hover, | |
button.is-submitted:active { | |
background: #27ae60; | |
outline: 0; | |
} | |
.button { | |
height: 6rem; | |
width:20rem; | |
font-size:2rem; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment