소금디자인

텍스트 검색창

· 2022-01-07 (금) 09:33:10 · 5938 · 1

기존에 검색 마킹시스템에서 검색바를 추가 했습니다.

검색을 종료하고싶을때는 리프레쉬버튼을 클릭하여 페이지를 리로드 합니다. 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    <li class="searchCon"><i class="fas fa-search" style="cursor:pointer;"></i></li>
      <li class="searchBar">
      <form id="f1" name="f1" action="javascript:void()">
        <input type="text" id="t1" name="t1" style="width:60px; font-size:20px; border:1px solid #eee;">
        <input type="button" value="검색" id="search_btn" style="font-size:16px; border:1px solid #eee; background-color:pink; padding:5px; color:white; border-radius:5px; cursor:pointer;">
      </from>
      </li>
 
 
 
    <script>
      let searchCon = document.querySelector(".searchCon");
      let textinput = document.querySelector(".searchBar");
      let searchIcob = document.querySelector(".fa-search");
      textinput.style.display = "none";
 
      searchCon.onclick = function searchBar(){
        
        if(textinput.style.display == "none" && searchCon.className == "searchCon"){
          searchCon.className += " searchOn"
          textinput.style.display = "";
          searchIcob.className = "fas fa-sync-alt";
        } else {
          searchCon.className = "searchCon"
          textinput.style.display = "none";
          history.go(0);
        }
      }
    </script>
cs
|

댓글 1개

감사합니다!!
댓글을 작성하시려면 로그인이 필요합니다.
+
제목 글쓴이 날짜 조회
22-01-09 조회 5,631
22-01-07 조회 7,293
22-01-07 조회 6,078
22-01-07 조회 5,939
22-01-04 조회 6,482
22-01-03 조회 8,015
21-12-30 조회 6,474
21-12-30 조회 6,930
21-12-26 조회 7,461
21-12-19 조회 6,595
21-12-18 조회 6,873
21-12-17 조회 6,062
21-12-14 조회 6,565
21-12-10 조회 1.1만
21-12-10 조회 6,271
21-12-08 조회 1만
21-12-08 조회 1.2만
21-12-07 조회 7,279
21-12-04 조회 7,562
21-12-04 조회 6,221
21-12-03 조회 6,901
21-12-02 조회 6,280
21-12-02 조회 6,791
21-12-02 조회 6,488
21-12-02 조회 6,011
21-11-30 조회 7,183
21-11-23 조회 7,102
21-11-23 조회 6,234
21-11-23 조회 7,794
21-11-23 조회 6,709