$.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 - 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; }; $("img.lazy").show().lazyload({ effect : "fadeIn" }); $(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({ 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' }); }); $(document).ready(function() { $('.overlay').fadeOut(0),$(function() { $('.fadeInContent').animate({opacity:1},750,'easeInOutSine'),$(function() { }); }); });