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() { $('.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(); $('select').selectpicker({ 'selectedText': 'cat' }); }); $(window).load(function() { $('.overlay').animate({opacity:0},0),$(function() { $('.fadeInContent').animate({opacity:1},750,'easeInOutSine') }); });