search

Home  >  Q&A  >  body text

javascript - Why does it take two clicks to get the effect?

仅有的幸福仅有的幸福2861 days ago685

reply all(2)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-19 10:40:50

    First Clickbox的时候,才给menuboxClick event added. This method is not recommended and may risk memory leaks.

    It’s best to put out all the menu codes, so that the menubox event can be triggered at once

    reply
    0
  • 阿神

    阿神2017-05-19 10:40:50

    The logic is wrong. . . The menubox listening event here depends on the click event of the box. When the box is not clicked, a large section in the middle will not be executed, so no monitoring will be added to the menubox.
    These two listening events should be at the same level. Just put the monitoring events inside to the same level as the box

    reply
    0
  • Cancelreply