optimize for google pagespeed insights
git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3479 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
a2a93aab0e
commit
7ad52c8b89
145 changed files with 105899 additions and 4408 deletions
|
|
@ -1,6 +1,84 @@
|
|||
window.currentScroll = 0;
|
||||
|
||||
jQuery('body').removeClass('no-js');
|
||||
|
||||
|
||||
// Initialize library to lazy load images
|
||||
|
||||
var observer = lozad('.lozad', {
|
||||
threshold: 0.1,
|
||||
});
|
||||
observer.observe();
|
||||
|
||||
|
||||
jQuery("button.btn-mobile").bind("click", function(e) {
|
||||
e.preventDefault();
|
||||
jQuery(this).toggleClass('btn-mobile-active');
|
||||
jQuery('html').removeClass('noscroll');
|
||||
jQuery('#menu-overlay').remove();
|
||||
|
||||
if(jQuery(this).hasClass('btn-mobile-active')) {
|
||||
jQuery('body').append('<div id="menu-overlay"></div>');
|
||||
|
||||
if(!jQuery("#topMain").hasClass('nav-onepage') || window.width > 960) { /* onepage fix */
|
||||
jQuery('html').addClass('noscroll');
|
||||
window.currentScroll = jQuery(window).scrollTop();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(!jQuery("#topMain").hasClass('nav-onepage') || window.width > 960) { /* onepage fix */
|
||||
jQuery('html,body').animate({scrollTop: currentScroll}, 300, 'easeInOutExpo');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
var addActiveClass = false;
|
||||
jQuery("#topMain a.dropdown-toggle").bind("click", function(e) {
|
||||
|
||||
if(jQuery("button.btn-mobile").hasClass('btn-mobile-active') || jQuery("html").hasClass('touch')){
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
addActiveClass = jQuery(this).parent().hasClass("resp-active");
|
||||
jQuery("#topMain").find(".resp-active").removeClass("resp-active");
|
||||
|
||||
if(!addActiveClass) {
|
||||
jQuery(this).parents("li").addClass("resp-active");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
});
|
||||
jQuery(document).ready(function($) {
|
||||
if (jQuery(document).width() < 768) {
|
||||
jQuery('.widget').find('.collapse-widget').addClass('collapsed');
|
||||
jQuery('.widget').find('.collapse').removeClass('in');
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
"use strict";
|
||||
|
||||
window.addEventListener("load", function(){
|
||||
window.cookieconsent.initialise({
|
||||
"palette": {
|
||||
"popup": {
|
||||
"background": "#648859"
|
||||
},
|
||||
"button": {
|
||||
"background": "#f1d600"
|
||||
}
|
||||
},
|
||||
"position": "bottom",
|
||||
"content": {
|
||||
"message": "Diese Webseite verwendet Cookies, über die personenbezogene Daten erhoben werden können. Nähere Informationen zu den verwendeten Cookies finden Sie hier:",
|
||||
"dismiss": "Einverstanden!",
|
||||
"link": "Datenschutzerklärung",
|
||||
"href": "https://www.sterntours.de/datenschutz"
|
||||
}
|
||||
})});
|
||||
|
||||
/* ==============================================
|
||||
VIDEOS -->
|
||||
=============================================== */
|
||||
|
|
@ -20,7 +98,7 @@ jQuery(document).ready(function($) {
|
|||
.attr({
|
||||
width: '100%',
|
||||
height: 500,
|
||||
src: '//www.youtube-nocookie.com/embed/'+ expl,
|
||||
src: 'https://www.youtube-nocookie.com/embed/'+ expl,
|
||||
frameborder: 0,
|
||||
allowfullscreen: true,
|
||||
'data-st-video': this.id
|
||||
|
|
@ -146,40 +224,10 @@ jQuery(document).ready(function($) {
|
|||
createSlider($(this));
|
||||
});
|
||||
|
||||
/* ==============================================
|
||||
HEADER STICKY -->
|
||||
=============================================== */
|
||||
|
||||
var navbarCollapse = false;
|
||||
|
||||
$(window).scroll(function() {
|
||||
if(!navbarCollapse){
|
||||
if ($(this).scrollTop() > 1){
|
||||
$('header').addClass("sticky");
|
||||
}
|
||||
else{
|
||||
$('header').removeClass("sticky");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#navbar-collapse').on('shown.bs.collapse', function () {
|
||||
navbarCollapse = true;
|
||||
$('header').removeClass("sticky");
|
||||
$(window).scrollTop(0);
|
||||
|
||||
});
|
||||
|
||||
$('#navbar-collapse').on('hide.bs.collapse', function () {
|
||||
navbarCollapse = false;
|
||||
});
|
||||
|
||||
|
||||
/* ==============================================
|
||||
nav-tabs -->
|
||||
=============================================== */
|
||||
var hidWidth;
|
||||
var scrollBarWidths = 40;
|
||||
var windowW = $(window).width();
|
||||
|
||||
|
|
@ -276,7 +324,7 @@ jQuery(document).ready(function($) {
|
|||
/* ==============================================
|
||||
MENU HOVER -->
|
||||
=============================================== */
|
||||
if($(window).width() > 768){
|
||||
if($(window).width() > 768){
|
||||
|
||||
$(".header .navbar-nav .dropdown:not(.openClick)").hover(
|
||||
function() {
|
||||
|
|
@ -302,39 +350,11 @@ jQuery(document).ready(function($) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
$('.selectpicker').selectpicker({
|
||||
dropupAuto: false
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* ==============================================
|
||||
collapse_open -->
|
||||
=============================================== */
|
||||
|
||||
function collapse_open(){
|
||||
var windowW = $(window).width();
|
||||
if(windowW <= 768){
|
||||
$('.collapse-widget').addClass('collapsed');
|
||||
$('.collapse-widget').parents('.widget').find('.collapse').removeClass('in');
|
||||
}else{
|
||||
$('.collapse-widget').removeClass('collapsed');
|
||||
$('.collapse-widget').parents('.widget').find('.collapse').addClass('in');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var $frist = false;
|
||||
$(window).resize(function() {
|
||||
if(!$first){
|
||||
var $first = true;
|
||||
collapse_open();
|
||||
}
|
||||
});
|
||||
collapse_open();
|
||||
|
||||
|
||||
/* ==============================================
|
||||
nav-tabs -->
|
||||
=============================================== */
|
||||
|
|
@ -358,7 +378,7 @@ jQuery(document).ready(function($) {
|
|||
}, 500);
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
/* ==============================================
|
||||
tooltip -->
|
||||
|
|
@ -366,16 +386,10 @@ jQuery(document).ready(function($) {
|
|||
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* ==============================================
|
||||
carousel -->
|
||||
=============================================== */
|
||||
|
||||
$('.carousel').carousel({
|
||||
interval: 5000 //changes the speed
|
||||
})
|
||||
|
||||
/* ==============================================
|
||||
ACCORDION -->
|
||||
=============================================== */
|
||||
|
|
@ -434,25 +448,29 @@ jQuery(document).ready(function($) {
|
|||
$('#accordion_fd').on('hidden.bs.collapse', toggleChevron3);
|
||||
$('#accordion_fd').on('shown.bs.collapse', toggleChevron3);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ==============================================
|
||||
LIGHTBOX -->
|
||||
=============================================== */
|
||||
carousel -->
|
||||
=============================================== */
|
||||
|
||||
/*
|
||||
jQuery('a[data-gal]').each(function() {
|
||||
jQuery(this).attr('rel', jQuery(this).data('gal'));
|
||||
});
|
||||
jQuery("a[data-gal^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',slideshow:false,overlay_gallery: false,theme:'light_square',social_tools:false,deeplinking:false});
|
||||
$('.carousel').carousel({
|
||||
interval: 5000, //changes the speed
|
||||
});
|
||||
|
||||
/*$('#myCarousel').find(".fill[data-src]:not(.loaded)").each(function(i,v){
|
||||
$(v).addClass("loaded").css("background-image", "url("+$(v).attr("data-src")+")");
|
||||
});
|
||||
|
||||
|
||||
$('.travel-wrapper').find(".img-background[data-src]:not(.loaded)").each(function(i,v){
|
||||
$(v).addClass("loaded").css("background-image", "url("+$(v).attr("data-src")+")");
|
||||
});
|
||||
*/
|
||||
/* ==============================================
|
||||
CAROUSEL -->
|
||||
=============================================== */
|
||||
|
||||
$('.owl-fullwidth').owlCarousel({
|
||||
|
||||
/* ==============================================
|
||||
OWL CAROUSEL -->
|
||||
=============================================== */
|
||||
var owl = $('.owl-fullwidth').owlCarousel({
|
||||
loop:true,
|
||||
margin:0,
|
||||
nav:true,
|
||||
|
|
@ -460,7 +478,7 @@ jQuery(document).ready(function($) {
|
|||
navText: [
|
||||
"<i class='fa fa-angle-right'></i>",
|
||||
"<i class='fa fa-angle-left'></i>"],
|
||||
responsive:{
|
||||
responsive:{
|
||||
0:{
|
||||
items:1
|
||||
},
|
||||
|
|
@ -470,8 +488,19 @@ jQuery(document).ready(function($) {
|
|||
1000:{
|
||||
items:3
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
|
||||
/* onTranslated: function(me){
|
||||
$(me.target).find(".owl-item.active [data-src]:not(.loaded)").each(function(i,v){
|
||||
$(v).addClass("loaded").css("background-image", "url("+$(v).attr("data-src")+")");
|
||||
});
|
||||
},
|
||||
onInitialized: function(me){
|
||||
$(me.target).find(".owl-item.active [data-src]:not(.loaded)").each(function(i,v){
|
||||
$(v).addClass("loaded").css("background-image", "url("+$(v).attr("data-src")+")");
|
||||
});
|
||||
},*/
|
||||
|
||||
/* ==============================================
|
||||
BOX LINK -->
|
||||
|
|
@ -491,51 +520,6 @@ jQuery(document).ready(function($) {
|
|||
return false;
|
||||
});
|
||||
|
||||
/* function resize_box (){
|
||||
$('.owl-fullwidth:not(.noresize)').each(function(){
|
||||
var boxes = $(this).find('.hl5');
|
||||
var maxHeight = Math.max.apply(
|
||||
Math, boxes.map(function() {
|
||||
return $(this).height();
|
||||
}).get());
|
||||
boxes.height(maxHeight);
|
||||
});
|
||||
|
||||
$('a.item-button').each(function(){
|
||||
$(this).removeClass('single_line');
|
||||
$(this).removeClass('dobble_line');
|
||||
if($(this).height() <= 36){
|
||||
$(this).addClass('single_line');
|
||||
}else{
|
||||
$(this).addClass('dobble_line');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
resize_box();
|
||||
|
||||
$(window).resize(function() {
|
||||
resize_box();
|
||||
}); */
|
||||
|
||||
|
||||
/* ==============================================
|
||||
resize_travel_img with height < 190 -->
|
||||
=============================================== */
|
||||
|
||||
|
||||
/*function resize_travel_img (){
|
||||
$('.travel-wrapper').find('img').each(function(){
|
||||
if($(this).height() < 190){
|
||||
$(this).addClass('lower-height');
|
||||
}
|
||||
});
|
||||
}
|
||||
resize_travel_img();
|
||||
$(window).resize(function() {
|
||||
resize_travel_img();
|
||||
});*/
|
||||
|
||||
|
||||
/* ==============================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue