Created
July 5, 2019 16:36
-
-
Save bmann/e034749fdc41daf5b95f4ac09b05951a to your computer and use it in GitHub Desktop.
Tito Interested Users
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
jQuery.fn.shake = function(amount){ | |
$(this).velocity('callout.shake') | |
} | |
jQuery(function(){ | |
var callback | |
$('.register-interest-form').submit(function(){ | |
name = $('#register-name').val() | |
email = $('#register-email').val() | |
if($.trim(name) != '' && $.trim(email) != '') | |
{ | |
url = ["https://ti.to/ull/2015/interested_users/subscribe.json?&interested_user[email]=", email , "&interested_user[name]=", name, "&callback=?"].join('') | |
$.getJSON(url, null, function(data){}) | |
width = $('.register-interest-form').width() | |
height = $('.register-interest-form').height() | |
$('.register-interest-form') | |
.velocity({rotateY: 10, rotateX: 0}) | |
.velocity({x: 1900}, 200, 'linear') | |
.velocity({opacity: 0, x: 3000}, 100, 'linear') | |
.promise().done(function(){ | |
$('.register-interest-form').html(['<h2 class="thanks">', 'Thanks ', name.split(' ')[0], '</h2>'].join('')) | |
$('.register-interest-form').velocity({ | |
x: 0, y: 0, rotateY: 0, rotateX: 0, width: width, height: height}, 300, 'linear') | |
.velocity({opacity: 1}, 300, 'linear') | |
}) | |
} | |
else | |
{ | |
$('.register-interest-form').shake() | |
} | |
return false; | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment