/* * AppVerse JS */ jQuery(document).ready(function() { /* Homepage slider */ jQuery('#slider').bxSlider({ pager: true, captions: true, nextText: '', prevText: '' }); /* Slider icon animation */ jQuery('.slide-image').hover(function(){ jQuery(this).find('.fa').animate({ width: '276px', height: '276px', fontSize: '276px', padding: "-=10px" }, 300); }, function() { jQuery(this).find(".fa").animate({ width: "256px", height: "256px", fontSize: "256px", padding: "+=10px" }, 120); }); /* Header icon animation */ jQuery(".header-button").hover(function(){ jQuery(this).find(".button-icon").animate({ width: "64px", height: "64px", marginTop: "-=40px" }, 300); jQuery(this).find(".button-fa").animate({ width: "64px", height: "64px", fontSize: "64px", marginTop: "-=40px" }, 300); jQuery(this).find(".button-text").animate({ opacity: "0", marginTop: "+=16px" }, 300); }, function() { jQuery(this).find(".button-icon").animate({ width: "32px", height: "32px", marginTop: "+=40px" }, 120); jQuery(this).find(".button-fa").animate({ width: "32px", height: "32px", fontSize: "32px", marginTop: "+=40px" }, 120); jQuery(this).find(".button-text").animate({ opacity: "1", marginTop: "-=16px" }, 120); }); /* Bullet point animation (requires background animation plugin) */ jQuery(".widget ul li a").hover(function(){ jQuery(this).animate({ backgroundPosition: "(7px 7px)" }, 80); }, function() { jQuery(this).animate({ backgroundPosition: "(-5px 7px)" }, 240); }); /* Sidebar scrolling */ var $sidebar = jQuery("#secondary"), $window = jQuery(window), /*$height = $sidebar.css("height"), $area = $sidebar.parent().css("height"),*/ $height = parseInt(jQuery("#footer").css("height")) + parseInt(jQuery(".footer-widgets").css("height")), $area = parseInt(jQuery(document).height()), offset = $sidebar.offset(), topPadding = 20; $window.scroll(function() { /*console.log($window.scrollTop() + " > " + $area + " - " + $height); console.log($area - $height - parseInt($sidebar.css("height")));*/ $area = parseInt(jQuery(document).height()); if(($window.width() >= 1000) && ($window.height() > parseInt($sidebar.css("height"))) && (300 < ($area - $height - parseInt($sidebar.css("height"))))) { if($window.scrollTop() > ($area - $height - 160 - parseInt($sidebar.css("height")))) { $sidebar.css("position", "relative"); $sidebar.css("left", 0); $sidebar.css("top", ($area - $height - 140 - parseInt($sidebar.css("height")) - offset.top)); // - parseInt($window.height()) /*console.log($window.scrollTop() + " > " + $area + " - " + $height + " - " + parseInt($window.height()) + " - " + parseInt($sidebar.css("height")));*/ } else if(($window.scrollTop() + topPadding) > offset.top) { $sidebar.css("position", "fixed"); $sidebar.css("left", offset.left); $sidebar.css("top", topPadding); } else { $sidebar.css("position", "relative"); $sidebar.css("left", 0); $sidebar.css("top", 0); } } }); /* Responsive menu jQuery('#site-navigation').prepend('
'); jQuery('#site-navigation #menu-button').on('click', function(){ var menu = jQuery('#site-navigation').find('div'); if(menu.hasClass('open')) { menu.removeClass('open'); jQuery(this).removeClass('opened'); } else { menu.addClass('open'); jQuery(this).addClass('opened'); } });*/ /* Flash hacks */ var src; jQuery("iframe").each(function(){ src = jQuery(this).attr("src"); jQuery(this).attr("src", src+"?wmode=opaque"); }); /* Plugin hacks */ jQuery(".remove_button").attr("value", "Remove"); });