jQuery.fn.center = function () { this.css("position","fixed"); this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px"); this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px"); return this; } jQuery.fn.extend({ scrollToPoint: function (scrollSpeed) { if (jQuery(this).offset()) { var x = jQuery(this).offset().top - 200; jQuery('html,body').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; }; $(document).ready(function() { if ($('.cookie-message').length) { $('.cookie-message').cookieBar(); $('.cookie-message').on('cookieBar-close', function() { $(this).slideUp(); }); } $('.cookie-message').cookieBar().animate({opacity:1},750,'easeInOutSine'); $("img.lazy").show().lazyload({ effect : "fadeIn" }); $('.jquery_gallery a').lightBox(); $('a.lightbox').lightBox(); $("a[target=lightbox]").lightBox(); $('#infoboxcontent').draggable(); $('#infoboxcontent').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() > 100) { $('.scrollToTop').fadeIn(300,'easeInOutCubic'); } else { $('.scrollToTop').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' }); }); $(window).load(function () { $('#overlay').fadeOut(0),$(function() { $('#fadeInContent').fadeIn(750,'easeInOutCubic'),$(function() { var i = $(this).find('#fadeInContent iframe'); var is = $(i).attr('src'); i.delay(250).attr('src', is) }); }); });