Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- কাস্টম সার্চ বস্ক তৈরী করব কিভাবেঃ
- ==============================
- ধাপ-১ঃ HTML মার্কপ & CSS ষ্টাইল রেডি করা ।
- -------
- ধাপ-২ঃ jQuery বডিতে কল করা ।
- --------
- ধাপ-৩ঃ jQuery কমান্ড করা ।
- -------
- যেমনঃ
- HTML মার্কপঃ
- =====================
- <!DOCTYPE HTML>
- <html lang="en-US">
- <head>
- <meta charset="UTF-8">
- <title>fourth Task</title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
- <link rel="stylesheet" type="text/css" href="style.css" media="all" />
- </head>
- <body>
- <div class="fix main_menu_area">
- <div class="fix main_menu_wrapper">
- <div class="fix menu_left_logo">
- <a href="#" class="fix logo"><img src="google_logo.jpg" alt="" /></a>
- </div>
- <div class="fix search_button_wrapper">
- <button type="button" id="search_btn"><i class="fa fa-search"></i><i class="fa fa-times"></i></button>
- </div>
- <div class="fix main_menu">
- <ul id="nav_menu">
- <li><a href="#home"><span>Home</span></a></li>
- <li><a href="#about"><span>About</span></a></li>
- <li><a href="#product"><span>Our Product</span></a></li>
- <li><a href="#books"><span>Our Books</span></a></li>
- <li><a href="#contact"><span>Contact Us</span></a></li>
- <li><a class="external" href="http://www.google.com"><span>Google</span></a></li>
- </ul>
- </div>
- </div>
- <div class="fix search_box_area">
- <div class="fix search_box_wrapper">
- <div class="fix search_box">
- <form action="">
- <input type="text" placeholder="Search You Content !" class="search_input" />
- <button type="submit" class="search_submit"><i class="fa fa-search"></i></button>
- </form>
- </div>
- </div>
- </div>
- </div>
- --------------------------------------------------------------------------------------------
- CSS ষ্টাইলঃ
- ============
- body{margin:0;padding:0;font-size:16px;line-height:20px;font-family:arial;position: relative;}
- .fix:after{content:'';display: table;clear: both;}
- .main_menu_area{
- background: #000;
- position: relative;
- z-index: 9999;
- }
- .main_menu_area.fixed{
- position: fixed;
- top: 0px;
- left: 0px;
- width: 100%;
- height: auto;
- background: rgba(0, 0, 0, 0.9);
- }
- .main_menu_wrapper{
- width: 980px;
- margin: 0 auto;
- }
- .menu_left_logo{
- float: left;
- }
- a.logo{
- display: block;
- padding: 0px;
- font-size: 60px;
- line-height: 60px;
- text-decoration: none;
- color: #fff;
- -webkit-transition: all .5s;
- transition: all .5s;
- width: 200px;
- height: 100px;
- }
- a.logo img{
- display: block;
- max-width: 100%;
- -webkit-transition: all .5s;
- transition: all .5s;
- }
- a.logo:hover{}
- .main_menu_area.fixed a.logo{
- height: 50px;
- width: 100px;
- }
- .main_menu{
- float: right;
- }
- ul#nav_menu{
- margin: 0px;
- padding: 0px;
- }
- ul#nav_menu>li{
- float: left;
- display: inline-block;
- position: relative;
- }
- ul#nav_menu>li>a:before{
- content:'';
- position: absolute;
- top: 0px;
- left: 0px;
- width: 100%;
- height: 0%;
- background: #333;
- -webkit-transition: all .5s;
- transition: all .5s;
- -webkit-transform: skew(-10deg);
- }
- ul#nav_menu>li>a:after{content:'';
- position: absolute;
- bottom: 0px;
- left: 0px;
- width: 100%;
- height: 0%;
- background: #333;
- z-index: 1;
- -webkit-transition: all .5s;
- transition: all .5s;
- }
- ul#nav_menu>li>a:hover:before{
- height: 100%;
- }
- ul#nav_menu>li>a:hover:after{
- height: 0%;
- }
- ul#nav_menu>li>a.active:before{
- height: 100%;
- }
- ul#nav_menu>li>a.active:after{
- }
- ul#nav_menu>li>a{
- display: block;
- padding: 39px 20px;
- color: #fff;
- text-decoration: none;
- font-size: 18px;
- line-height: 22px;
- -webkit-transition: all .5s;
- transition: all .5s;
- position: relative;
- z-index: 9;
- }
- ul#nav_menu>li>a>span{
- position: relative;
- z-index: 10;
- }
- ul#nav_menu>li>a:hover{
- color: red;
- }
- ul#nav_menu>li>a.active{
- color: red;
- }
- .main_menu_area.fixed ul#nav_menu>li>a{
- padding: 14px 20px;
- }
- .contact_section{
- width: 800px;
- margin: 50px auto;
- }
- .body_content h1{
- text-align: center;
- font-size: 50px;
- line-height: 50px;
- }
- .contact_section p{margin-bottom:20px;}
- .section{
- padding: 30px 0px;
- }
- .section h2{
- text-align: center;
- font-size: 40px;
- line-height: 50px;
- }
- /* Search Button Style */
- .search_button_wrapper{
- float: right;
- }
- #search_btn{
- background: transparent;
- border: 0px solid #fff;
- color: #fff;
- height: 100px;
- width: 60px;
- text-align: center;
- font-size: 25px;
- -webkit-transition: all .5s;
- transition: all .5s;
- cursor: pointer;
- }
- #search_btn.change i.fa-search {
- display: none;
- }
- #search_btn i.fa-times {
- display: none;
- }
- #search_btn.change i.fa-times {
- display: block;
- }
- .main_menu_area.fixed #search_btn{
- height: 50px;
- }
- #search_btn:hover {
- background: #333;
- color: red;
- outline: 0;
- }
- #search_btn.change{
- background: #333;
- color: red;
- }
- #search_btn:focus {
- outline: 0;
- }
- .search_box_area{
- position: absolute;
- top: 100%;
- left: 0px;
- width: 100%;
- height: auto;
- background: #000;
- border-top: 2px solid #333;
- display: none;
- }
- .main_menu_area.fixed .search_box_area{
- background: rgba(0, 0, 0, 0.9);
- }
- .search_box_wrapper{
- width: 980px;
- margin: 0 auto;
- padding: 20px 0px;
- }
- .search_box{
- background: #fff;
- border-radius: 500px;
- overflow: hidden;
- }
- .main_menu_area.fixed .search_box{
- background: rgba(255, 255, 255, 0.8);
- }
- input.search_input{
- display: inline-block;
- float: left;
- width: 90%;
- border: 0px solid #fff;
- padding: 10px 20px;
- font-size: 20px;
- height: 23px;
- background: transparent;
- }
- input.search_input:hover, input.search_input:focus {
- outline: 0;
- }
- button#contact_close{
- position: absolute;
- top: 30px;
- right: 50px;
- width: 50px;
- height: 50px;
- background: #fff;
- border: 0px solid #fff;
- font-size: 30px;
- cursor: pointer;
- }
- button.search_submit{
- width: 5%;
- background: transparent;
- border: 0px solid #fff;
- height: 44px;
- font-size: 20px;
- cursor: pointer;
- -webkit-transition: all .5s;
- transition: all .5s;
- }
- button.search_submit:hover, button.search_submit:focus {
- outline: 0;
- color: red;
- }
- jQuery কমান্ডঃ
- =============
- // jQuery For Custom Search Box
- $(document).ready(function() {
- $('button#search_btn').on('click', function() {
- $(this).toggleClass('change').parents('div.main_menu_area').find('div.search_box_area').fadeToggle(500);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement