$.fn.center = function () { var heightRatio = ($(window).height() != 0) ? this.outerHeight() / $(window).height() : 1; var widthRatio = ($(window).width() != 0) ? this.outerWidth() / $(window).width() : 1; this.css({ position: 'fixed', margin: 0, top: (50*(1-heightRatio)) + "%", left: (50*(1-widthRatio)) + "%" }); return this; } jQuery.fn.extend({ scrollToPoint: function (scrollSpeed) { if (jQuery(this).offset()) { var x = jQuery(this).offset().top - 100; jQuery('html,body').stop().animate({scrollTop: x}, scrollSpeed,'easeInOutCubic'); } }}); jQuery.fn.extend({ scrollToPoint2: function (scrollSpeed) { if (jQuery(this).offset()) { var x = jQuery(this).offset().top + jQuery('#slideshow').width()/100*35; jQuery('html,body').stop().animate({scrollTop: x}, scrollSpeed,'easeInOutCubic'); } }}); function jqUpdateSize(a,b,c){ var width = $(c).width(); var height = $(c).height(); if (a == 1) return width; if (b == 1) return height; }; function customScrollToPoint(a,b){ $('#' + a).scrollToPoint(b); }; function customScrollToPointAT(a,b,c){ setTimeout(function(){ $('#' + a).stop().scrollToPoint(b); }, c); }; $(document).ready(function() { if ($('.cookie-message').length) { $('.cookie-message').cookieBar(); $('.cookie-message').on('cookieBar-close', function() { $(this).slideUp(); }); } $("img.lazy").show().lazyload({ effect : "fadeIn" }); $('#head_logo').donnerScroller(); $('.cookie-message').cookieBar().animate({opacity:1},750,'easeInOutSine'); $('.jquery_gallery a').lightBox(); $('#infoboxcontent').draggable(); $('#infoboxcontent').center(); $('#fadingBarsG').center(); $('input[type=file]').bootstrapFileInput(); $('.file-inputs').bootstrapFileInput(); $('[data-toggle=popover]').popover({ container: 'body', delay: {show : 500, hide : 500} }); //Check to see if the window is top if not then display button $(window).scroll(function(){ if ($(this).scrollTop() > 280) { $('.scrollToTop').stop().fadeIn(300,'easeInOutCubic'); } else { $('.scrollToTop').stop().fadeOut(300,'easeInOutCubic'); } }); //Click event to scroll to top $('.scrollToTop').click(function(){ $('html, body').animate({scrollTop : 0},800,'easeInOutCubic'); return false; }); $('select').selectpicker({ 'selectedText': 'cat' }); $('.mobile_menu').click(function() { $('.ul-firstlevel').toggleClass('visible'); }); if ($('input.makler-block').length) { $('input.makler-block').change( function() { var $input = $( this ); var $attributes = ""; var $text = ""; var $aaa = ""; if ($input.prop("checked")) { if ($('div.makler-block').length) { $.each($('div.makler-block').data(), function( index, value ) { $attributes = $attributes + index + "=\"" + value + "\" "; }); $aaa = $('div.makler-block').html(); $aaa = $aaa.replace("<","<"); $aaa = $aaa.replace(">",">"); $aaa = $aaa.replace(/\"/g,"""); $attributes = $attributes + "data-divtext=\"" + $aaa + "\""; if ($attributes.length) { $('div.makler-block').before(""); $('div.makler-block').remove(); } } } else { if ($('iframe.makler-block').length) { $("iframe.makler-block").each(function() { $.each(this.attributes,function(i,a){ if (a.name != "class" && a.name != "style") { if (a.name != "data-divtext") { $attributes = $attributes + "data-" + a.name + "=\"" + a.value + "\" "; } else { $text = a.value; } } }); if ($attributes.length) { $('iframe.makler-block').before("
"+ $text +"
"); $('iframe.makler-block').remove(); } }); } } }) .change(); } }); $(window).load(function() { $( function() { $('.ref_container').isotope({ layoutMode: 'packery', itemSelector: '.item', packery: { columnWidth: 190 } }); }); $('.overlay').animate({opacity:0},0),$(function() { $('.fadeInContent').animate({opacity:1},750,'easeInOutSine') }); });