Home  >  Q&A  >  body text

js怎样实现在类似qq的联系人分组中进行搜索后,又可恢复原分组的界面?

在QQ首页面进行联系人搜索后,面板会出现相关的联系人,如果将搜索框中的联系人清除,QQ界面又恢复到原来的联系人分组界面,怎样用js或jquery实现这个分组界面恢复的过程?请指教,谢谢!

phpcn_u274phpcn_u2742760 days ago792

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:56:42

    How can js restore the original group interface after searching in a QQ-like contact group? -PHP Chinese website Q&A-How can js restore the original group interface after searching in a contact group similar to QQ? -PHP Chinese website Q&A

    Let’s take a look and learn.

    reply
    0
  • 阿神

    阿神2017-01-23 11:30:46

    1.搜索框绑定事件。
    2.事件触发时,根据input的value遍历存储联系人的对象或者数组中联系人的名字。
    3.符合条件的放入一个叫filter,就是存储过滤结果的对象或数组中。
    4.根据filter的长度来调用前面写好的一个,生成联系人的信息块的函数。
    5.其中value为空的时候,显示全部或者一个都不显示,看你的需求。

    reply
    0
  • Cancelreply