You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.1 KiB
75 lines
2.1 KiB
/**
|
|
* Created by Алексей on 10.03.2016.
|
|
*/
|
|
|
|
$(document).ready(function(){
|
|
$('input').placeholder();
|
|
|
|
$('.reviews-slides').bxSlider({
|
|
pagerCustom: '.reviews-listing',
|
|
nextText: ' ',
|
|
prevText: ' ',
|
|
onSliderLoad: function () {
|
|
$(".reviews .bx-pager.bx-default-pager").remove();
|
|
}
|
|
});
|
|
|
|
$('.scroll-top').on('click', function(e){
|
|
$('html,body').stop().animate({ scrollTop: $('.header').offset().top }, 1000);
|
|
e.preventDefault();
|
|
});
|
|
|
|
$('.popup-open-btn').click(function (e) {
|
|
e.preventDefault();
|
|
|
|
$('.overlay').fadeIn(400,
|
|
function () {
|
|
$('.popup-app')
|
|
.css('display', 'block')
|
|
.animate({opacity: 1}, 200);
|
|
});
|
|
return false;
|
|
});
|
|
|
|
$('.popup__close, .overlay').click(function () {
|
|
$('.popup')
|
|
.animate({opacity: 0}, 200,
|
|
function () {
|
|
$(this).css('display', 'none');
|
|
$('.overlay').fadeOut(400);
|
|
}
|
|
);
|
|
});
|
|
|
|
$("form.popup-form").on("submit", function(e){
|
|
console.log('11');
|
|
e.preventDefault();
|
|
var $form = $(this),
|
|
url = $form.attr("action"),
|
|
data = $form.serialize(),
|
|
type = $form.attr('method');
|
|
|
|
$form.find('.error').removeClass('error');
|
|
|
|
$.ajax({
|
|
url: url,
|
|
type: type,
|
|
data: data,
|
|
success: function(data){
|
|
if (data.success) {
|
|
$form.parents('.popup').fadeOut(200, function() {
|
|
$('.popup-thank')
|
|
.css('display', 'block')
|
|
.animate({opacity: 1}, 200);
|
|
});
|
|
}
|
|
|
|
if (data.errors) {
|
|
$.each(data.errors, function(i, val) {
|
|
$form.find('input[name="' + i + '"]').addClass('error')
|
|
});
|
|
}
|
|
}
|
|
});
|
|
})
|
|
});
|
|
|