ÔÎĵØÖ·:https://github.com/AlloyTeam/AlloyTouch/wiki/Pull-to-refresh
Ч¹ûչʾ ɨÂëÌåÑéÄãÒ²¿ÉÒÔµã»÷ÕâÀï·ÃÎÊDemo
¿ÉÒÔµã»÷ÕâÀï²é¿´´úÂë
ÔÚÊÖ»úQQÄÚ²¿£¬Æäʵ¿Í»§¶ËÌṩÁËÏÂÀˢеÄÄÜÁ¦£¬Í϶¯Õû¸öwebview½øÐÐÏÂÀˢУ¬loadingÒÔ¼°loadingÏà¹ØµÄwordingºÍ¶¯»¶¼ÊÇ¿Í»§¶ËµÄ¡£½â¾öÁËÒ»²¿·ÖÐèÒªÏÂÀ³¡¾°µÄÎÊÌâ¡£µ«ÊÇÔÚijЩ³¡¾°Ï£¬»¹ÊÇÐèÒªwebÓµÓÐ×ÔÉíµÄÏÂÀˢеÄÄÜÁ¦¡£±ÈÈ磺
¶øÍ϶¯Õû¸öwebviewµÄÏÂÀË¢ÐÂÎÞ·¨Âú×ãÕâЩ³¡¾°¡£AlloyTouchºÜÃ÷ÏԷdz£Éó¤´¦ÀíwebÏÂÀˢеÄÐèÇó¡£
Ò³Ãæ¹Ç¼ÜʵÏÖpullRefreshÔÚAlloyTouch headerµÄÏÂÃ棬ÆäÖУº
header zIndex > pullRefresh zIndex >wrapperºÍscrollerµÄ zIndex¡£
¿´ÒÔ¿´µ½£¬ÏÂÀµ½Ò»¶¨³Ì¶È£¬¼ýÍ·ÓиöÐýת¶¯»£¬ÒÔ¼°wordingÃèÊöÒ²»á±ä»¯¡£ÕâÀïÖ÷ÒªÀûÓÃjsÈ¥Çл»classȥʵÏÖ£¬¶¯»Ê¹ÓÃCSS transitionʵÏÖ¡£ËùÒÔÒªÔ¤Ïȶ¨ÒåºÃÁ½ÖÖclass¡£
.arrow { margin5px; margin5px; } ...(180deg)(180deg); } .20px.4s ease; }
ͨ¹ýÉÏÃ涨ҪºÃµÄclass£¬ÔÚjsÂß¼ÀïÃæÖ»ÐèÒª¸ºÔðremoveºÍadd arrow_up clas±ã¿ÉÒÔʵÏÖ¼ýÍ·ÐýתºÍwordingµÄÇл»¡£
Loading¶¯»ÊµÏÖxmlnspreserveAspectRatiorect xwidthfill... ... </svg>
loadingЧ¹ûʹÓÃSVGȥʵÏÖ£¬ÀûÓÃ12¸örectµÄ indefinite animateȥʵÏÖ¡£begin´ú±í¿ªÊ¼Ê±¼äÓиöµÝÔö´ïµ½loadingµÄЧ¹û¡£
ºËÐÄʵÏÖvar scroller = document.querySelector("#scroller"), arrow = document.querySelector("#arrow"), pull_refresh = document.querySelector("#pull_refresh"), list = document.querySelector("#list"), index (pull_refresh(scroller(scroller.(value) .(evt) ..(evt) .()(at) .(len (.index.....); }
²»·Ï»°£¬¶¼ÔÚ×¢ÊÍÀï¡£
¿ªÊ¼AlloyTouchGithub£ºhttps://github.com/AlloyTeam/AlloyTouch
ÈκÎÒâ¼ûºÍ½¨Ò黶Ónew issue£¬AlloyTouchÍŶӻáµÚһʱ¼ä·´À¡¡£
¡¡