Skip to content

Instantly share code, notes, and snippets.

View liliumbs's full-sized avatar
👔
Get up ‣ Eat ‣ Code ‣ Repeat

F. Gogic liliumbs

👔
Get up ‣ Eat ‣ Code ‣ Repeat
  • Sarajevo, Bosnia and Herzegovina
  • 15:45 (UTC +01:00)
View GitHub Profile
@liliumbs
liliumbs / sform.css
Created February 3, 2012 08:01
Google Like Search Form - CSS
/* search form div container */
#searchform {
margin:20px;
}
/* Styling the search input field */
#field {
float:left;
width:300px;
height:27px;
@liliumbs
liliumbs / sform.js
Created February 3, 2012 08:02
Google Like Search Form - JavaScript
$(document).ready(function() {
// if text input field value is not empty show the "X" button
$("#field").keyup(function() {
$("#x").fadeIn();
if ($.trim($("#field").val()) == "") {
$("#x").fadeOut();
}
});
// on click of "X", delete input field value and hide "X"
$("#x").click(function() {