$(document).ready(function() { "use strict"; // Placehdoler polyfill $('input, textarea').placeholder(); // Load parallax conditionally // Removed Home Parallax /* var is_home = location.pathname; yepnope({ test : Modernizr.mq('(min-width: 880px)') && Modernizr.multiplebgs && is_home == "/", yep : '/wp-content/themes/NetworkingTas/assets/js/vertical-parallax.js', nope : '' }); */ // Make dropdown list change page on mobile view $(".dropdown-list select").change(function() { window.location = $(this).find("option:selected").val(); }); // Remove input value on focus $('#username').each(function() { var default_value = this.value; $(this).focus(function(){ if(this.value == default_value) { this.value = ''; } }); $(this).blur(function(){ if(this.value == '') { this.value = default_value; } }); }); // Dock menu on scroll var $body = $('body'), $nav = $('#navigation'), $header = $('header') $(window).scroll(function() { $body.toggleClass( 'docked', $(window).scrollTop() > $header.outerHeight() ); }); // Revealed/hidden content $('.more-button').live('click', function(e){ $(this).parent().siblings('.revealed-content').slideToggle(); $(this).toggleClass('open'); e.stopPropagation(); }); // Reveal/hide Latest News $('#close-news').live('click', function(e){ $(this).parent('.full-news').slideToggle(); }); $('#open-news').live('click', function(e){ $(this).siblings('.full-news').slideToggle(); }); // Scroll to content $("#navigation ul li a[href^='#']").live('click', function(e) { e.preventDefault(); $('html, body').animate({ scrollTop: $(this.hash).offset().top - 115 }, 900); }); // Scroll to top $(".back-to-top").click(function() { $("html, body").animate({ scrollTop: 0 }, 900); return false; }); });