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