').html( $.parseHTML( newPageRawHTML.match(/
]*>([\s\S.]*)<\/head>/i)[0], document, true ) ); var headTags = [ "meta[name='subject']", "meta[name='robots']", "meta[name='copyright']", "meta[name='keywords']", "meta[name='description']", "meta[itemprop]", "meta[property^='og']", "meta[name^='twitter']", ].join(','); $('head').find(headTags).remove(); $newPageHead.find(headTags).appendTo('head'); var position = $('#bodytop').offset().top; $("html, body").animate({scrollTop:position}, 500, "swing"); $('#barba-wrapper .barba-container').animate({opacity: '1'}, 1000); $('a[name!="_"][href^="#"]').click(function(){ var speed = 500; var href= $(this).attr("href"); var target = $(href == "#" || href == "" ? 'html' : href); var position = target.offset().top; $("html, body").animate({scrollTop:position}, speed, "swing"); return false; }); return false;});});