search

Home  >  Q&A  >  body text

There is a small problem about switching js that I haven’t figured out yet

Account login parameters ('0','register_',1)

Scan QR code login parameters ('1','register_',1)

<script type ="text/javascript">
function ChangeReg(divId,divName,Count){
for(var i=0;i<=Count;i ){
document.getElementById(divName i). style.display='none'
      }
          document.getElementById(divName divId).style.display='block'
   }

</script>

When I click to scan the code to log in, i=0, so the result is

document.getElementById(register_ 0).style.display='none' //register0 hides

document.getElementById(register 1).style.display='block'//register1 displays

If I click the account again to log in, then i=1, so scan the code to hide the account and display

Then if I click the scan code again, i= Several? Shouldn't it be i=2? Then doesn’t the condition of the for loop hold true?

It’s because the condition is no longer true, so we start from the beginning, so i=0 again? do you mean this?

鹰弘网络科技鹰弘网络科技2093 days ago1111

reply all(2)I'll reply

  • 查无此人

    查无此人2019-04-16 14:31:12

    1,

    Not logged in or logged in? There should be only two of these states. Why is there a third state?

    Not logged in 0, 1 after logged in.

    So whether it is account login or scan login, it should be 1.

    2, ​

    If you are in the login box, the left side is the account login, and the right side is the scan login.

    Then click on the left and change it to 0.

    Click on the right and change 1.

    There will be no 2.

    reply
    0
  • Cancelreply