Page effects that need to be clicked in order by the link

Source: Internet
Author: User

    • Need to click on the link page effect in one order, some front-end developers named it "first click after Link", need to follow the requirements of a click link before the specified link to take effect, remember that this function is often used in advertising above, users do not click on the ads, you can not activate a link, but this function is a bit annoying ah, Or do not use as well, this code is only for learning a programming idea.

<HTML><Head><Scriptlanguage= "JavaScript">varNum= 3; //Total LinksvarMyPage= 'http://www.baidu.com'; //Destination link AddressvarPissoff= 'Please enter NetEase 163 first from above, only then can enter Baidu's homepage from here';//here is the tip message Allow=Array (); //Open ArrayAllow[num]= 2; //the last link is the one that ultimately needs to be clicked.functiongotoit (link) {//Record Click Status    if(Link!=num) {                //If the click is not the last oneAllow[link]= 2; //The link that is currently clicked is logged    } Else {                    //otherwise (a link needs to be checked)         for(i=1; I<=Num;i++){            //Check the click status of each previous link            if(Allow[i]!= 2){        //If a link has not been clickedI=Num+ 1; //prepare to exit the loopLemmein= 0; //set flag, do not allow links            } Else {            //otherwise (each of the preceding has been clicked)Lemmein= 1; //setting the Allow flag            }        }        if(Lemmein== 1){        //if the link is allowedwindow.location=MyPage;//navigation is done by changing the window location        } Else {                    //otherwisealert (Pissoff); //Pop-up tip information        }    }}//---></Script><styletype= "Text/css"><!--A{Color:000000;font-size:11pt;text-decoration:None}a:hover{Color:a0a0a0} -</style><title>Shijiazhuang Slag slurry Pump Parts</title></Head><Body><P><b><ahref= "Http://www.163.com"OnClick= "Gotoit (1)"Target= "_blank">To enter Baidu Search, you must first click here to enter NetEase</u></a><BR></b><P><b><ahref="/"OnClick= "Gotoit (2)"Target= "_blank"The occurrence of > Hair</u></a><BR></b><P><b><ahref= "Javascript:gotoit (num)">Finally can enter Baidu search from here OH</a></b></Body></HTML>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.