You've already forked bryanpedini.it_old
Added PHP and javascript control for the contact form, moved javascript from template page to a dedicated script file
This commit is contained in:
22
js/onePageApp-contactForm.js
Normal file
22
js/onePageApp-contactForm.js
Normal file
@@ -0,0 +1,22 @@
|
||||
(function ($) {
|
||||
$(function () {
|
||||
$('#contact-form-send').click(function () {
|
||||
$.ajax({
|
||||
url: 'contactme/webform.php',
|
||||
method: 'POST',
|
||||
datatype: 'JSON',
|
||||
data: {
|
||||
name: $('#contact-form-name'),
|
||||
email: $('#contact-form-email'),
|
||||
message: $('#contact-form-message')
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#scrolldown-button").click(function() {
|
||||
$('html,body').animate({
|
||||
scrollTop: $("#contact-form").offset().top
|
||||
}, 'slow');
|
||||
});
|
||||
$("#contact-form-message").css('overflow', 'hidden').autogrow({vertical: true, horizontal: false, flickering: false});
|
||||
});
|
||||
})(jQuery);
|
Reference in New Issue
Block a user