Advertisement
firoze

Search bar Hide and Show when click

Feb 21st, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. <!-- Search Bar start -->
  2. <div class="search_area" style="background-color:#FCF8E3;">
  3. <div class="container">
  4. <div class="row">
  5. <div class="col-md-12">
  6. <div class="serch_form">
  7. <div class="form-group has-success has-feedback">
  8. <label class="control-label" for="inputGroupSuccess1">Search What you are looking for....</label>
  9. <div class="input-group">
  10.  
  11. <input style="height:50px" type="text" class="form-control" id="inputGroupSuccess1" aria-describedby="inputGroupSuccess1Status" placeholder="Search........">
  12. <span class="input-group-addon search-areaser"><span class="fa fa-search" ></span></span>
  13. </div>
  14.  
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. <!-- Search bar End -->
  22.  
  23.  
  24. /*******************************hide and show button***************************************************************/
  25.  
  26. <div id="search-button" style="margin-top:35px;">
  27. <ul style="margin-top">
  28. <li class="search-form" style="border: 1px dashed #fff;
  29. color: #fff;
  30. cursor: pointer;
  31. display: list-item;
  32. float: right;
  33. list-style: outside none none;
  34. margin-right: 50px;
  35. padding: 14px 20px;"><span class="fa fa-search"></span></li>
  36.  
  37. <li id="search-form" style="padding:14px 20px;color:#fff;cursor:pointer;border:1px dashed #fff;float: right;
  38. list-style: outside none none;
  39. margin-right: 50px;"><span class="fa fa-times"></span></li>
  40. </ul>
  41. </div>
  42.  
  43.  
  44. /***********************************show the below code in footer***************************************************************/
  45.  
  46. <script>
  47. $(document).ready(function(){
  48. $(".search-form").click(function(){
  49. $(".search_area").show(1);
  50. $(".search-form").hide(1);
  51. $("#search-form").show(1);
  52. });
  53. $("#search-form").click(function(){
  54. $(".search_area").hide(1);
  55. $(".search-form").show(1);
  56. $("#search-form").hide(1);
  57. });
  58. });
  59. </script>
  60. <style type="text/css">
  61. .search_area{display:none;}
  62. #search-form {
  63. display: none;
  64. float: right;
  65. margin-bottom: 0;
  66. margin-right: 116px;
  67. overflow: hidden;
  68. }
  69. .input-group-addon.search-areaser{padding:0 25px}
  70.  
  71. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement