Faux Headline news app, pull-down refresh, pull-up load paging

Source: Internet
Author: User

---restore content starts---

Environmental Appcan

Appcan.ready (function() {page= 1; Type= 0; Searchdate=Getnowtime ();            Highsearch (type); Appcan.frame.setBounce ([0,1],function(type) {//$ ("#pullstatus" +type). html (!type? "). Start drop down ":" Start on Drag ");},function(type) {//$ ("#pullstatus" +type). html (!type? "). Pull over the tipping point and produce the event! ":" Over the tipping point, the event has been generated! ");},function(type) {//$ ("#pullstatus" +type). HTML ("Let go, generate events, start updating data! ");SetTimeout (function() {appcan.frame.resetBounce (type); //$ ("#pullstatus" +type). HTML ("");                                                if(type==0){                            //Drop-down refreshpage = 1;                        Highsearch (type); }Else if(type==1){                            //Pull up load next pagepage++;                        Highsearch (type); }                    }, 1000);        }); });

Add the above code to the Ready function, and the page is used to record paging, and type is used to determine whether the drop-down refresh or pull-up loads the next page of news.

The function to load the news is to have the page property to load the corresponding paging, and to have the if of the type judged.

For example

if (Type = = 1) {                    $ ("#searchHighResult"). Append (str);                    Appcan.window.openToast ("Loading Complete", 5, 0);                 Else {                    $ ("#searchHighResult"). html (str);                    Appcan.window.openToast ("Refresh succeeded", 5, 0);                }

Note that append and html,append are additional

Faux Headline news app, pull-down refresh, pull-up load paging

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.