Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try {
  2.     var $searchIcon =   '.glyphicon-search.search-icon';
  3.     jQuery( $searchIcon ).css( 'cursor', 'pointer' );
  4.     jQuery( $searchIcon ).click( function(){
  5.         var $formParent = jQuery(this).parent();
  6.         var $searchInput = $formParent.find( 'input[name=s]' );
  7.         var $searchValue = $searchInput.val();
  8.        
  9.         if( $searchValue == '' ){
  10.             $searchInput.focus();
  11.         }
  12.         else{
  13.             window.location.href = jsvar.home_url + '?s=' + $searchValue;
  14.         }
  15.     } )
  16. } catch (e) {
  17.     // TODO: handle exception
  18.     console.log( e.message );
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement