jQuery( document ).ready( function( $ ){ $( '.flexslider' ).flexslider( { animation: "slide", controlNav: true } ); $( '.clients' ).flexslider( { animation: "slide", animationLoop: false, itemWidth: 240, directionNav: true, controlNav: false, maxItems: 4 } ); $( '.tabs-container' ).tabs(); /* Get the window's width, and check whether it is narrower than 480 pixels */ var windowWidth = $( window ).width(); if ( windowWidth <= 600 ) { /* Clone our navigation */ var mainNavigation = $( '.primary-menu' ).clone(); /* Replace unordered list with a "select" element to be populated with options, and create a variable to select our new empty option menu */ $( '.primary-menu' ).html( '' ); var selectMenu = $( 'select.menu' ); /* Navigate our nav clone for information needed to populate options */ $( mainNavigation ).children( 'ul' ).children( 'li' ).each( function() { /* Get top-level link and text */ var href = $( this ).children( 'a' ).attr( 'href' ); var text = $( this ).children( 'a' ).text(); /* Append this option to our "select" */ var option = '