<! DOCTYPE html>DL Dt{background: #ccc;p adding:5px;} DL Li{padding:5px;list-Style:none;} p{height:100px;} Html,body{margin:0;padding:0;} </style> <script type= ' Text/javascript ' >//<! [Cdata[$(function(){ //$ (' DL '). Grouplist (); Relative to the top of the window$ (' DL '). Grouplist (true);}); $.fn.grouplist=function(selfscroll) {varList = This; varListtopoffset =List.offset (). Top; varTitleheight = $ (list). Find (' Dt:first '). Height (); varCurrentContext = Selfscroll?List:window; if(selfscroll) {list.css ({' Height ': $ (window). Height ()-Listtopoffset,' Overflow ': ' Auto ' }); } $ (CurrentContext). On (' Scroll ',function(){ if($ (CurrentContext). ScrollTop ()-(Selfscroll 0:listtopoffset) <titleheight) {clearfixed (); }Else{ varLis = List.find (' li '); for(vari = 0, len = lis.length; i < Len; i++){ if(Isonsight (Lis[i])) {clearfixed (). Filter ('. Clone '). Remove (); Lis.eq (i). Parent (). Parent (). Prev (). Clone (true). addclass (' Clone '). css ({' Top ': Selfscroll? listtopoffset:0, ' Position ': ' Fixed ', ' Width ': ' 100% '}). AppendTo (list); Break; } } } }); varIsonsight =function(item) {returnSelfscroll? Listtopoffset < $ (item). offset (). Top + $ (item). Outerheight (): $ (CurrentContext). ScrollTop () < $ (item). offset (). Top +$ (item). Outerheight (); } varClearfixed =function(){ return$ (list). Find (' DT '). css ({' Position ': ' }); }}//]]></script>JS version of iphone contacts Group list effect