/*
____ _____ _____ ____ ____ __ ___ _ _ _______ __ _ _ _
| _ \ | _ || _ || _ \ | _ \ / \ / __|| |_| ||__ __| | \ | || | | |
| | | || | | || | | || |_| || | | | / /\ \ / / | _ | | | | \ \| || | | |
| |_| || |_| || |_| || _ / | |_| | / /__\ \ \ \__ | | | | | | _ | |\ || |_| |
|____/ |_____||_____||_| \_\|____/ /_/ \_\ \___||_| |_| |_| (_)|_| \__| \___/
*/
function onScroll(event){
var scrollPos = $(document).scrollTop();
$('.one-page').each(function(index, element) {
var $currLink = $(this);
var refElement = $currLink.attr("href");
var sdasd = $currLink.attr("href");
var offset = 0; offset = 70;
refElement = refElement.substring(refElement.indexOf("#") - 1);
refElement = refElement.substring(1);
if(refElement.indexOf("#") !== 0){ refElement = '#'+refElement; }
refElement = $(refElement);
if(refElement.length > 0){
if(scrollPos >= 0){
if (refElement.position().top - offset <= scrollPos && (refElement.position().top - offset) + refElement.height() > scrollPos) {
$(this).parent().find('.one-page').parent().removeClass("current-page"); $(this).parent().addClass("current-page");
}else{ $(this).parent().removeClass("current-page");
}
}
}
});
}
function GetImageExt(filename){
return (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename) : undefined;
}
function ImageResize($this, $shortname, $parent){
var parentw;
if($parent === 'parent()'){ parentw = $this.parent().innerWidth();}
else{ parentw = $this.parent().parent().parent().parent().innerWidth();}
var w = $this.innerWidth(); if(!w){w = 1600;}
var src = $this.attr('src');
if(src){
var imgext = GetImageExt(src); imgext = imgext[0];
var numext = imgext.length; numext = numext + 5;
var newsrc = src.slice(0, - numext);
var numbers = [1600, 1366, 1280, 1024, 800, 640, 480, 320, 200, 100];
var closest = null;
$.each(numbers, function(){
if(closest === null || this > w){closest = this;} if(this < w){return false;}
});
var final = $shortname+'_'+closest+'.'+imgext;
$this.attr('src', final);
}
}
function ImageBgResize($this, $shortname, $parent){
var parentw;
if($parent === 'parent()'){parentw = $this.parent().innerWidth();}
else{parentw = $this.parent().parent().parent().parent().innerWidth();}
var w = $this.innerWidth(); if(!w){w = 1600;}
var src = $this.css('background-image');
if(src){
src = src.replace('url(',''); src = src.replace(')',''); src = src.replace('"',''); src = src.replace('"','');
var imgext = GetImageExt(src);
imgext = imgext[0];
var numext = imgext.length; numext = numext + 5;
var newsrc = src.slice(0, - numext);
var numbers = [1600, 1366, 1280, 1024, 800, 640, 480, 320, 200, 100];
var closest = null;
$.each(numbers, function(){
if(closest === null || this > w){closest = this;} if(this < w){return false;}
});
var final;
if(!$shortname){final = newsrc+'_'+closest+'.'+imgext;}
else{final = $shortname+'_'+closest+'.'+imgext;}
$this.css('background', ''); $this.css('background', "url("+final+")");
}
}
function SetFooter(){
$("#footer").attr('style','');
var footerh = $('#footer').innerHeight();
var bodyHeight = $('#layout').height(); bodyHeight = bodyHeight + footerh;
var windowHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
if(windowHeight > bodyHeight){ $("#footer").css({"position":"absolute", "bottom": 0});}
}
function ForceImgAlt(){
var $image = ''; $image = $('img');
var $imagesrc = '';
var siteurl = '';
if(siteurl){
siteurl = document.location.origin; siteurl = siteurl.replace(/[&\/\\#_,+()$~%.'":*?<>{}]/g, '');
}
$image.each(function() {
if(!$(this).attr("alt")) {
$imagesrc = $(this).attr('src').replace(/\.[^/.]+$/, '').replace(/\d/g, '').replace(/[&\/\\#_,+()$~%.'":*?<>{}]/g, '').replace(siteurl+'uploads', '');
$(this).attr('alt', $imagesrc);
}
});
}
function FullheightContainer(){
$('.fullheightcontainer').each(function(){
var browserheight = $(window).outerHeight();
var strokepaddingtop = parseInt($(this).parents('.stroke').css('padding-top'));
var strokepaddingbot = parseInt($(this).parents('.stroke').css('padding-top'));
var strokepaddingtot = strokepaddingtop + strokepaddingbot;
var strokinnerheight = browserheight - strokepaddingtot;
$(this).parents('.stroke').css('height',browserheight);
$(this).css('height','100%');
$(this).find('.row').first().css('height','100%');
$(this).find('.row-inner').first().css('height','100%');
$(this).find('.row-inner [class*="col-"]').first().css('height','100%');
if($(this).find('.mind-slider').length > 0){
//$(this).find('.mind-slider, .mind-slider .slides').css('height', strokinnerheight);
}
if($(this).find('.googlemaps-element').length > 0){
//$(this).find('.googlemaps-element').css('height', strokinnerheight);
}
});
}
function EqualheightContainer(){
var windowwcheck = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
if(windowwcheck >= 480){
$('.equalheightcontainer').each(function(index, element) {
var contheight = '';
var countel = $(this).find('[id*="element-"]').length;
if(countel > 1){
$(this).find('[id*="element-"]').each(function(index, element) {
$(this).css('height','');
if($(this).find('.googlemaps-element').length > 0){$(this).find('.googlemaps-element').css('height','');}
var testone = $(this).outerHeight();
var testtwo = $(this).innerHeight();
var containerheight = $(this).innerHeight();
if(containerheight > contheight || contheight === undefined){contheight = containerheight;}
});
$(this).find('[id*="element-"]').each(function(index, element) {
$(this).css('height',contheight);
if($(this).find('.googlemaps-element').length > 0){$(this).find('.googlemaps-element').css('height',contheight);}
});
}
});
}else{
$('.equalheightcontainer').each(function(index, element) {
$(this).find('[id*="element-"]').each(function(index, element) {
$(this).css('height','');
if($(this).find('.googlemaps-element').length > 0){$(this).find('.googlemaps-element').css('height','');}
});
});
}
}
$(window).load(function(e){
SetFooter();
FullheightContainer();
EqualheightContainer();
ForceImgAlt();
$('img.check-resize').each(function(index, element) {
if($(this).parent().hasClass('thumbnail')){ ImageResize($(this), $(this).data('shortname'), 'parent()');
}else{ ImageResize($(this), $(this).data('shortname'));
}
});
$('.check-bg-resize').each(function(index, element) {
if($(this).parent().hasClass('thumbnail')){ ImageBgResize($(this), $(this).data('shortname'), 'parent()');
}else{ ImageBgResize($(this), $(this).data('shortname'));
}
});
$('img').each(function(index, element) {
var attrh = $(this).attr('height');
var attrw = $(this).attr('width');
var thish = $(this).height();
var thisw = $(this).width();
if(attrh){
if(attrh === '' || attrh === 0){ if(thish !== ''){ $(this).attr('height', thish); } }
}else{ if(thish !== ''){ $(this).attr('height', thish); } }
if(attrw){
if(attrw === '' || attrw === 0){if(thisw !== ''){$(this).attr('width', thisw);}}
}else{if(thisw !== ''){$(this).attr('width', thisw);}}
});
if($('.yendifplayer').length > 0){
$('.yendifplayer').each(function(index, element){
if($(this).parents('.slide').find('.slide-elements .link-element').length > 0){
$(this).parents('.slide').find('.slide-elements .link-element').remove();
}
$(this).yendifplayer({
engine: 'html5',
responsive: 1,
embed: 0
});
$(this).find("a").last().remove();
});
}
$('.mind-slider .hasvideo').parents('.mind-slider').find('.bullets').remove();
$('.mind-slider .next, .mind-slider .prev').on('click',function(e){$(this).parent().find('.slide.active').find('video').trigger("pause");});
$(window).trigger('resize');
});
$(window).resize(function(e) {
SetFooter();
FullheightContainer();
EqualheightContainer();
$('.slide, .thumbnail').each(function(index, element){ $(this).MindSetImages({ alignmenttop: 'center', alignmentleft: 'center'});});
$('img.check-resize').each(function(index, element) {
if($(this).parent().hasClass('thumbnail')){ ImageResize($(this), $(this).data('shortname'), 'parent()');
}else{ ImageResize($(this), $(this).data('shortname'));
}
});
$('.check-bg-resize').each(function(index, element) {
if($(this).parent().hasClass('thumbnail')){ ImageBgResize($(this), $(this).data('shortname'), 'parent()');
}else{ImageBgResize($(this), $(this).data('shortname'));
}
});
$('video').each(function(index, element) {
var thisheight = $(this).parents('.slide').innerHeight();
if(!thisheight){ thisheight = $(this).parents('.stroke').innerHeight(); }
var thiswidth = $(this).parents('.slide').innerWidth();
if(!thiswidth){ thiswidth = $(this).parents('.stroke').innerWidth(); }
});
});
$(document).ready(function () {
ForceImgAlt();
if ($('.ie-box').length > 0) {
$('.ie-box').show().animate({ top: "0px"}, 1000);
$('.icon-close').on('click', function(event){
$('.ie-box').show().animate({top: "-60px"}, 1000, function(event){
$(this).remove();
});
});
}
$('.container').each(function(index, element) {
var nopadding = $(this).data('nopadding');
var nomargin = $(this).data('nomargin');
var keepinnermargin = $(this).data('keepinnermargin');
var forcemargin = $(this).data('forcemargin');
var abovebreadcr = $(this).data('abovebreadcr');
var divcenter = ''; divcenter = $(this).data('center');
var $target;
if(abovebreadcr === true){
if($('.breadcrumb').length !== 0){$(this).parent('[class*="col-"]').insertBefore($('.breadcrumb'));
}else{$(this).insertBefore( $('.content_inner').find('.stroke').first() );
}
}
if(divcenter !== '' && divcenter !== undefined){
var towrap = '';
if(divcenter === 'dev-10'){ towrap='
';
}else if(divcenter === 'dev-8'){ towrap='';
}else if(divcenter === 'dev-6'){ towrap='';
}else if(divcenter === 'dev-4'){ towrap='';
}else if(divcenter === 'dev-2'){ towrap ='
';
}
if(towrap){$(this).find('.row-inner').wrapInner(towrap);}
}
if(nopadding === true){
$(this).addClass('p-0');
$(this).parent().addClass('p-0');
if(forcemargin !== true){$(this).find('[class*="col-"]').each(function(){$(this).addClass('p-0');});}
}else{
var paddingt = $(this).data('paddingtop');
var paddingb = $(this).data('paddingbottom');
var paddingl = $(this).data('paddingleft');
var paddingr = $(this).data('paddingright');
var paddingtarget = $(this).data('paddingtarget');
if(paddingtarget === 'container'){$target = $(this);}else{$target = $(this).parent();}
if(paddingt || paddingt === 0){$target.css('padding-top', paddingt);}
if(paddingb || paddingb === 0){$target.css('padding-bottom', paddingb);}
if(paddingl || paddingl === 0){$target.css('padding-left', paddingl);}
if(paddingr || paddingr === 0){$target.css('padding-right', paddingr);}
}
if(nomargin === true){
$(this).addClass('m-0');
$(this).parent().addClass('m-0');
if(keepinnermargin !== true){
$(this).find('[class*="col-"]').each(function() {
$(this).addClass('m-0');
});
}
}else{
var margint = $(this).data('margintop');
var marginb = $(this).data('marginbottom');
var marginl = $(this).data('marginleft');
var marginr = $(this).data('marginright');
var margintarget = $(this).data('margintarget');
if(margintarget === 'container'){$target = $(this);}else{$target = $(this).parent();}
if(margint || margint === 0){$target.css('margin-top', margint);}
if(marginb || marginb === 0){$target.css('margin-bottom', marginb);}
if(marginl || marginl === 0){$target.css('margin-left', marginl);}
if(marginr || marginr === 0){$target.css('margin-right', marginr);}
}
});
$(document).on('click', '.mobile-icon', function(){
$(this).parents('.header-wrapper').toggleClass('is-active');
$('.content').toggleClass('pushed');
});
$(document).on('click', '.dropdown-trigger', function(){
$('.header-wrapper').toggleClass('open');
});
$('.print-page').on('click', function(){window.print(); return( false );});
var footerheight = $('#footer').outerHeight(true); var browserheight = $(window).height(); var wrapperheight = browserheight - footerheight; $('#wrapper').css('min-height', wrapperheight+'px');
$('input.temp_el_type[value="productwidget"], input.temp_el_type[value="projectwidget"], input.temp_el_type[value="image"], input.temp_el_type[value="htmlslider"]').each(function() {
$(this).parent().addClass('p-0');
});
});
$(document).ready(function () {
$(document).on("scroll ready", onScroll);
$('a.one-page').on('click', function (e) {
e.preventDefault();
$(document).off("scroll");
$('a.one-page').each(function(){$(this).removeClass('current-page');});
$(this).addClass('current-page');
var target;
var menu;
target = this.hash;
menu = target;
var $target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 500, 'swing', function () {
window.location.hash = target; $(document).on("scroll", onScroll);
});
});
});
var scrollTop = 50;
var element = 'firststroke';
if(element === ''){scrollTop = 50;}
else if(element === 'firststroke'){
//scrollTop = $('.stroke:first-child').innerHeight();
scrollTop = 75;
}
$(document).ready(function(){
if($(window).scrollTop() >= scrollTop){
$('.header-wrapper').addClass('nav-scrolled');
}else if($(window).scrollTop() < scrollTop){
$('.header-wrapper').removeClass('nav-scrolled');
}
$(window).scroll(function(){
if($(window).scrollTop() >= scrollTop){
$('.header-wrapper').addClass('nav-scrolled');
}else if($(window).scrollTop() < scrollTop){
$('.header-wrapper').removeClass('nav-scrolled');
}
});
});
!function(){function t(t){this.message=t}var r="undefined"!=typeof exports?exports:this,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",r.btoa||(r.btoa=function(r){for(var o,n,a=String(r),i=0,c=e,d="";a.charAt(0|i)||(c="=",i%1);d+=c.charAt(63&o>>8-i%1*8)){if(n=a.charCodeAt(i+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return d}),r.atob||(r.atob=function(r){var o=String(r).replace(/=+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,d="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?d+=String.fromCharCode(255&n>>(-2*i&6)):0)a=e.indexOf(a);return d})}();(function ($) {
$.fn.serialize = function (options){return $.param(this.serializeArray(options));};
$.fn.serializeArray = function (options){var o = $.extend({checkboxesAsBools: false}, options || {});
var rselectTextarea = /select|textarea/i; var rinput = /text|hidden|password|search/i;
return this.map(function (){return this.elements ? $.makeArray(this.elements) : this;})
.filter(function (){return this.name && !this.disabled && (this.checked || (o.checkboxesAsBools && this.type === 'checkbox') || rselectTextarea.test(this.nodeName) || rinput.test(this.type));})
.map(function (i, elem) {var val = $(this).val(); return val == null ? null : $.isArray(val) ? $.map(val, function (val, i) { return { name: elem.name, value: val }; }) : { name: elem.name, value: (o.checkboxesAsBools && this.type === 'checkbox') ? (this.checked ? 'true' : 'false') : val};}).get();};
})(jQuery);
$(window).load(function () {
$(".submit-form").on("click",function(event) {
event.preventDefault();
var empty = 0; var empnr = 0; counter = 0;
var error = '';
var errorid = '';
var formid = '';
var singleerror = false;
var errorstyle = 'modern';
if($(this).parents('form').find('.form-error-minimal').val() == 'true'){var singleerror = true;}
if($(this).parents('form').find('.form-error-style').val() == 'normal'){var errorstyle = 'normal';}
if($(this).parents('form').find('.form-error-style').val() == 'minimal'){var errorstyle = 'minimal';}
var erroridarr = [];
$(this).parent().parent('form').find('.form-row').each(function(){
if($(this).find(':input').val() == ''){empnr=empnr+1;}
counter++;
$(this).find('.required').each(function(index, element) {
var name = $(this).attr("name");
if(name == undefined){
var name = $(this).find(':input').attr("name");
}
var type = $(this).attr("type");
if(type == undefined){
var type = $(this).find(':input').attr("type");
if(type == undefined){
if ($(this).is("textarea")) {
var type = 'textarea';
}else if ($(this).is("select")) {
var type = 'select';
}else if ($(this).is("file")) {
var type = 'file';
}
}
}
var thisval = $(this).val();
if(name == thisval){
empty = empty + 1;
errorid = $(this).parent().find('label').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+"
";}
}
if(type == 'text'){
var filter = '';
filter = $('input[type="text"][name="'+name+'"]').parent().find('.form-text-filter').val();
}
if(type == 'text'){
if(!$(this).val()){
empty = empty + 1;
errorid = $(this).parent().find('label').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+"
";}
}else{
if(filter != ''){
var currentval = $('input[type="text"][name="'+name+'"]').val();
if(filter == 'email'){
var regex = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/;
var check = regex.test(currentval);
if(check == false){
empty = empty + 1;
errorid = $(this).parent().find('label').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+" is een incorrect e-mailadres
";}
}
}else if(filter == 'telefoon'){
currentval = currentval.replace(/\s+/g, '');
var regex1 = /^(((0)[1-9]{2}[0-9][-]?[1-9][0-9]{5})|((\+31|0|0031)[1-9][0-9][-]?[1-9][0-9]{6}))$/;
var regex2 = /^(((\+31|6|0|0031)6){1}[-]?[1-9]{1}[0-9]{7})$/i;
var regex3 = /^(((0)[1-9]{2}[0-9][-]?[1-9][0-9]{5})|((\+31|0|0031)[1-9][0-9][-]?[1-9][0-9]{6})|((\+31|0|0031)[1-9]{2}[0-9][-]?[1-9][0-9]{5}))$/;
var check1 = regex1.test(currentval);
var check2 = regex2.test(currentval);
var check3 = regex3.test(currentval);
if(check1 == false){
if(check2 == false){
if(check3 == false){
empty = empty + 1;
errorid = $(this).parent().find('label').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+" is een incorrect telefoonnummer.
";}
}
}
}
}else if(filter == 'nummer'){
var regex = /^[0-9]+$/;
var check = regex.test(currentval);
if(check == false){
empty = empty + 1;
errorid = $(this).parent().find('label').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+" is een incorrect waarde, deze mag alleen bestaan uit cijfers.
";}
}
}else if(filter == 'letters'){
var regex = /^[A-Za-z ]+$/;
var check = regex.test(currentval);
if(check == false){
empty = empty + 1;
errorid = $(this).parent().find('label').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+" is een incorrect waarde, deze mag alleen bestaan uit letters.
";}
}
}else if(filter == 'url'){
var regex1 = /^(?!www | www\.)[A-Za-z0-9_-]+\.+[A-Za-z0-9.\/%&=\?_:;-]+$/;
var regex2 = /^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/;
var check1 = regex1.test(currentval);
var check2 = regex2.test(currentval);
if(check1 == false){
if(check2 == false){
empty = empty + 1;
errorid = $(this).parent().find('label').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+" is een incorrect url.
";}
}
}
}
}
}
}else if(type == 'radio'){
if($(this).find('input[type="radio"][name="'+name+'"]:checked').length == 0){
empty = empty + 1;
errorid = $(this).parent().find('label:first').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+"
";}
}
}else if(type == 'checkbox'){
if($(this).parent().find('input[type="checkbox"]:checked').length == 0){
empty = empty + 1;
errorid = $(this).parent().find('label:first').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+"
";}
}
}else if(type == 'textarea'){
if($(this).val() == ''){
empty = empty + 1;
errorid = $(this).parent().find('label:first').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+"
";}
}
}else if(type == 'select'){
if($(this).val() == ''){
empty = empty + 1;
errorid = $(this).parent().parent().find('label:first').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+"
";}
}
}else if(type == 'file'){
if($(this).val() == ''){
empty = empty + 1;
errorid = $(this).parent().find('label:first').text();
if(errorid == ''){errorid = name;}
erroridarr.push(name);
if(singleerror == false || error == '' && singleerror == true){error+= "- "+errorid+"
";}
}
}
});
});
if(counter == empnr){
empty = empty + 1;
error+= "- Alle velden zijn leeg
";
}
if(empty == 0){
//foreach input do the unique upload
callbacks = '';
globalthis = $(this);
var baseHref = document.getElementsByTagName('base')[0].href
var countfiles = $(this).parent().parent('form').find('input:file').length;
if(countfiles != 0){
var inputs = $(this).parent().parent('form').find('input:file');
$.each(inputs, function(index, val) {
var index = index + 1;
var thisval = $(this).val();
if(thisval != ''){
var thisname =$(this).parent().find('label').text();
var thisid = $(this).attr('id');
var dataToPost = new FormData();
dataToPost.append("formfileupload", $("#"+thisid).get(0).files[0]);
$.ajax({
async:false,
url: "../inc/fileupload.php",
type: "POST",
contentType: false,
processData: false,
data: dataToPost,
error: function(_, textStatus, errorThrown){console.log(textStatus, errorThrown);},
success: function(response, textStatus){
callbacks+= '&'+thisname+'='+baseHref+response;
if(countfiles == index){
ContinueFor();
}
}
});
}else{
if(countfiles == index){
ContinueFor();
}
}
});
}else{
ContinueFor();
}
function ContinueFor(){
var thisdata = globalthis.parent().parent('form').serialize();
var formid = globalthis.parent().parent('form').parent().parent().find('.stroke_d_id').val();
console.log(formid);
var dataString = thisdata + callbacks +'&thisurl=' + document.URL + '&formid=' + formid;
var url = '/inc/functions/submitform.php';
$.ajax({
type: "POST",
url: url,
context: globalthis,
data: dataString,
success: function(data){
if(data == ''){
var databack = "We konden de email niet verzenden, probeer het nogmaals.";
$(this).parent().parent('form').find('.form-return').empty().append('
Er ging iets mis
'+databack+'
').show().delay(6000).queue(function(n) {
$(this).hide(); n(); $(this).empty();
});
var scrollh = $(this).parents('form').find('.form-return').offset().top;
var itemhei = $(this).parents('form').find('.form-return').outerHeight();
var toscrol = scrollh - itemhei - 200;
$(window).scrollTop(toscrol);
}else{
$(this).parents('form').children().not('.form-return').hide(); $(this).parent().parent('form')[0].reset();
$(this).parents('form').find('.form-return').empty().append('
Succesvol verzonden
'+data+'
').show().delay(6000).queue(function(n) {
$(this).hide(); $(this).empty();
$(this).parents('form').children().not('.form-return').show();
$(this).parents('form').find('.form-error').hide();
});
var scrollh = $(this).parents('form').find('.form-return').offset().top;
var itemhei = $(this).parents('form').find('.form-return').outerHeight();
var toscrol = scrollh - itemhei - 200;
$(window).scrollTop(toscrol);
}
}
});
}
}else{
var errormessage = 'Oepsss! Je hebt niet alles ingevuld.';
if($(this).parents('form').find('.form-error-message').length > 0){
if($(this).parents('form').find('.form-error-message').val() != ''){
var errormessage = $(this).parents('form').find('.form-error-message').val();
}
}
if(errorstyle == 'modern'){
$this = $(this);
var counterror = 0;
erroridarr.forEach(function(inputname) {
if(singleerror == true && counterror == 0 || singleerror != true){
$this.parent().parent('form').find(':input[name="'+inputname+'"]').addClass('empty-error');
var scrollh = $this.parents('form').find('.empty-error').first().offset().top;
var itemhei = $this.parents('form').find('.empty-error').first().outerHeight();
var toscrol = scrollh - itemhei - 80;
$("html, body").animate({ scrollTop:toscrol }, 440);
setTimeout(function(){ $this.parents('form').find(':input[name="'+inputname+'"]').removeClass('empty-error'); }, 1800);
}
counterror++;
});
}else{
if(errorstyle == 'minimal'){error = '';}
$this = $(this);
$(this).parents('form').find('.form-error p').empty().append(errormessage+'
'+error).parent().parent().fadeIn(600, function(e){
var scrollh = $this.parents('form').find('.form-error').offset().top;
var itemhei = $this.parents('form').find('.form-error').outerHeight();
var toscrol = scrollh - itemhei - 80;
$("html, body").animate({ scrollTop:toscrol }, 440);
});
}
}
return false;
});
});
$(document).ready(function(e){
$('.radiobtn-group label').on('click', function(){
if($(this).parent().find('label').hasClass('active') != true){
$(this).addClass('active');
}else{
$(this).parent().find('label').removeClass('active');
$(this).addClass('active');
}
});
$('.checkbox-group label').on('click', function(){
if($(this).hasClass('active') != true){
$(this).addClass('active');
}else{
$(this).removeClass('active');
}
});
$('.form-modern-placeholder, .form-row.above :input').on('click', function(){
var thisval = $(this).val();
var thisname = $(this).attr('name');
if(thisval == thisname){$(this).val('');}
$(this).parent().addClass("active");
});
$('.form-modern-placeholder, .form-row.above :input').on('blur', function(){
var thisval = $(this).val();
var thisname = $(this).attr('name');
if(thisval == ''){
if($(this).hasClass('form-modern-placeholder')){$(this).val(thisname);}
$(this).parent().removeClass("active").removeClass('filled');
}else{
$(this).addClass('filled');
}
});
$('.form-row.left :input').on('focus', function(){
$(this).parent().addClass("active");
});
$('.form-row.left :input').on('blur', function(){
if($(this).val() === '' || $(this).val() === 'blank'){
$(this).parent().removeClass("active");
}
});
});