jquery code implementation Pull-up loading

Source: Internet
Author: User

Tag: INF append GPO operation HTML body scrolltop jquer timeout

1$ (window). Scroll (function () {2 //has scrolled to the top of the page height3 varSl_top = $ ( This). scrolltop ();4 //page Height5 varDm_height =$ (document). Height ();6 //browser window Height7 varWd_height = $ ( This). Height ();8 9 //here is the event triggered by the scroll bar to the bottom, where the data to be loaded is written, or the action that pulls the scroll barTen if($ (' #J_loadingData '). CSS (' display ') = = "None"){ One if(Dm_height = = parseint (sl_top+wd_height)) { A$ (' #J_loadingData '). Show (); -SetTimeout (function(){ - Ajaxdata (); the},3000) - } -  - } + }); - //Request Data + functionAjaxdata () { A$.get (' Data/index.json ',function(resp) { at if(Resp.code = = 1){ -$ (' #J_loadingData '). Hide (); - varlihtml = ' '; -$.each (Resp.data.commodityList,function(){ -lihtml + = ' < a href= "" > " -+ ' <li> ' in+ ' <div class= ' left-picture ' > ' -+ ' < img src= ' + This. commodityimg+ ' "/> ' to+ ' </div> ' ++ ' <div class= ' right-info ' > ' -+ ' <span class= "commodity-title" > ' + This. commodityinfo+ ' </span> ' the+ ' <span class= "Market-price" > Market Price: ¥ ' + This. marketprice+ ' </span> ' *+ ' <span class= "Sc-price" > Mori nest Price: ¥ ' + This. scprice+ ' </span> ' $+ ' </div> 'Panax Notoginseng+ ' </li> ' -+ ' </a> '; the }) +$ ('. Commodity-list ')). Append (lihtml); A  the } + }) -}

jquery code implementation Pull-up loading

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.