单击时如何显示

我已经创建了一个移动导航,当单击搜索图标时,它将展开,并且旁边的徽标将通过添加类hide而消失。但是当我单击鼠标时,我不知道如何找回图标。谁能帮我吗?谢谢!

导航栏

单击时如何显示

具有扩展搜索功能的导航栏

单击时如何显示

以下是代码:

<form class="mobile-search-container" action="https://www.tumblr.com/Search">
   <input id="search-box" type="text" class="search-box" name="q" />
   <label for="search-box"><i class="material-icons search-icon">search</i></label>
   <input type="submit" id="search-submit" />
</form>
<script>
    document.addEventListener("touchstart",function(){},true);
</script>
<a href="#" class="header-logo d-flex flex-align-items-center" id="header-logo"></a>
<script>
    $("#search-box").click(function(){
    $("#header-logo").addClass("hide");
    });

</script>
gehui19890302 回答:单击时如何显示

您可以使用Error in `$<-.data.frame`(`*tmp*`,"name",value = character(0)) : replacement has 0 rows,data has 301 In addition: Warning messages: 1: Unknown or uninitialised column: 'name'. Show Traceback jQuery事件,类似于此:

focusout
,

您要在搜索框以外的任何位置显示图标,因此可以在单击正文时进行操作:

LinkedList.java:16: error: cannot find symbol
      current.setNext(x);
             ^
  symbol:   method setNext(T)
  location: variable current of type T
  where T is a type-variable:
    T extends Object declared in class LinkedList
LinkedList.java:24: error: cannot find symbol
      ptr = ptr.getNext();
               ^
  symbol:   method getNext()
  location: variable ptr of type T
  where T is a type-variable:
    T extends Object declared in class LinkedList
2 errors

但是,单击搜索框也会触发body.click,因此,当您通过添加$('body').click(function(){ $("#header-logo").removeClass("hide"); }); 来单击搜索框时,应避免单击body:

event.stopPropagation()
本文链接:https://www.f2er.com/3161892.html

大家都在问