Skip to content

Instantly share code, notes, and snippets.

@wilornel
Created April 17, 2012 00:29
Show Gist options
  • Select an option

  • Save wilornel/2402534 to your computer and use it in GitHub Desktop.

Select an option

Save wilornel/2402534 to your computer and use it in GitHub Desktop.
<script>
$(document).ready(function(){
$('body').keypress(function(){
event.preventDefault();
$('#input').focus();
});
$('#input').keypress(function(){
event.stopPropagation();
});
$('#input').keyup(function(){
if(event.keyCode == 13){
$('#search').click();
};
});
$('#search').click(function(){
// Here // Alert the value of the input
var query = $('#input').val();
alert(query);
});
$('.item').hover(function(){
$(this).addClass('hovered');
},function()
$(this).removeClass('hovered');
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment