Upload files to 'assets/js'
This commit is contained in:
parent
fedf622a4f
commit
a5159c327f
48
assets/js/ajax-form.js
Normal file
48
assets/js/ajax-form.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
$(function() {
|
||||
|
||||
// Get the form.
|
||||
var form = $('#contact-form');
|
||||
|
||||
// Get the messages div.
|
||||
var formMessages = $('.ajax-response');
|
||||
|
||||
// Set up an event listener for the contact form.
|
||||
$(form).submit(function(e) {
|
||||
// Stop the browser from submitting the form.
|
||||
e.preventDefault();
|
||||
|
||||
// Serialize the form data.
|
||||
var formData = $(form).serialize();
|
||||
|
||||
// Submit the form using AJAX.
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: $(form).attr('action'),
|
||||
data: formData
|
||||
})
|
||||
.done(function(response) {
|
||||
// Make sure that the formMessages div has the 'success' class.
|
||||
$(formMessages).removeClass('error');
|
||||
$(formMessages).addClass('success');
|
||||
|
||||
// Set the message text.
|
||||
$(formMessages).text(response);
|
||||
|
||||
// Clear the form.
|
||||
$('#contact-form input,#contact-form textarea').val('');
|
||||
})
|
||||
.fail(function(data) {
|
||||
// Make sure that the formMessages div has the 'error' class.
|
||||
$(formMessages).removeClass('success');
|
||||
$(formMessages).addClass('error');
|
||||
|
||||
// Set the message text.
|
||||
if (data.responseText !== '') {
|
||||
$(formMessages).text(data.responseText);
|
||||
} else {
|
||||
$(formMessages).text('Oops! An error occured and your message could not be sent.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
1
assets/js/backToTop.js
Normal file
1
assets/js/backToTop.js
Normal file
|
@ -0,0 +1 @@
|
|||
!function(s){"use strict";s(".switch").on("click",function(){s("body").hasClass("light")?(s("body").removeClass("light"),s(".switch").removeClass("switched")):(s("body").addClass("light"),s(".switch").addClass("switched"))}),s(document).ready(function(){var e=document.querySelector(".progress-wrap path"),t=e.getTotalLength();e.style.transition=e.style.WebkitTransition="none",e.style.strokeDasharray=t+" "+t,e.style.strokeDashoffset=t,e.getBoundingClientRect(),e.style.transition=e.style.WebkitTransition="stroke-dashoffset 10ms linear";var o=function(){var o=s(window).scrollTop(),r=s(document).height()-s(window).height(),i=t-o*t/r;e.style.strokeDashoffset=i};o(),s(window).scroll(o);jQuery(window).on("scroll",function(){jQuery(this).scrollTop()>50?jQuery(".progress-wrap").addClass("active-progress"):jQuery(".progress-wrap").removeClass("active-progress")}),jQuery(".progress-wrap").on("click",function(s){return s.preventDefault(),jQuery("html, body").animate({scrollTop:0},550),!1})})}(jQuery);
|
7
assets/js/bootstrap.bundle.min.js
vendored
Normal file
7
assets/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
assets/js/imagesloaded.pkgd.min.js
vendored
Normal file
7
assets/js/imagesloaded.pkgd.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
12
assets/js/isotope.pkgd.min.js
vendored
Normal file
12
assets/js/isotope.pkgd.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user