Hey Blogger friends,Google is updating itself these days.Like search bar,Gmail inbox etc and etc.So why dont we also upgrade with google addons and plugins.So here i m sharing with you a beautiful hack to show the new Google search bar on your Blog which looks like the image below
/* New Style Search Bar start */
#searchContainer {
margin:20px;
}
#field {
float:left;
width:200px;
height:27px;
line-height:27px;
text-indent:10px;
font-family:arial, sans-serif;
font-size:1em;
color:#333;
background: #fff;
border:solid 1px #d9d9d9;
border-top:solid 1px #c0c0c0;
border-right:none;
}
#delete {
float:left;
width:16px;
height:29px;
line-height:27px;
margin-right:15px;
padding:0 10px 0 10px;
font-family: “Lucida Sans”, “Lucida Sans Unicode”,sans-serif;
font-size:22px;
background: #fff;
border:solid 1px #d9d9d9;
border-top:solid 1px #c0c0c0;
border-left:none;
}
#delete #x {
color:#A1B9ED;
cursor:pointer;
display:none;
}
#delete #x:hover {
color:#36c;
}
#submit {
cursor:pointer;
width:70px;
height: 31px;
line-height:0;
font-size:0;
text-indent:-999px;
color: transparent;
background: url(http://4.bp.blogspot.com/-GX7E4j3jwR0/ThMXKjuQ9VI/AAAAAAAAEsE/rJE5Ip1qDEg/s1600/ico-search.png) no-repeat #4d90fe center;
border: 1px solid #3079ED;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
}
#submit:hover {
background: url(http://4.bp.blogspot.com/-GX7E4j3jwR0/ThMXKjuQ9VI/AAAAAAAAEsE/rJE5Ip1qDEg/s1600/ico-search.png) no-repeat center #357AE8;
border: 1px solid #2F5BB7;
}
.fclear {clear:both}
TIP : Change the Green Code according to your sidebar or where you place the widget.
Now copy the code below and paste it above </head> tag of your template
<script src=’http://code.jquery.com/jquery-1.6.1.min.js’ type=’text/javascript’/>
<script type=’text/javascript’>
$().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() {
$("#field").val("");
$(this).hide();
});
});
</script>
Now Preview if error free, Click on SAVE TEMPLATE
Enjoyed the article,Comment for sure…
2 Comments