var itm = window.itm || {}; ( function ( window, document, $, undefined ) { 'use strict'; itm = { init : function () { itm.bind(); }, bind : function () { $( '.search-toggle' ).on( 'click', itm.toggleSearch ); $( '.to-the-top' ).on( 'click', itm.scrollToTop ); }, toggleSearch : function ( event ) { event.preventDefault(); $(this).toggleClass( 'active' ); $( '.search-container' ).slideToggle(); }, scrollToTop : function ( event ) { event.preventDefault(); $( 'html, body' ).animate({ scrollTop: 0 }, 500); } }; itm.init(); })( window, document, jQuery );