| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- $.mobile.document.on( "pageshow", "#linkbar-page", function() {
- var head = $( ".ui-page-active [data-role='header']" ),
- foot = $( ".ui-page-active [data-role='footer']" ),
- filter = $( ".ui-page-active [role='search']" ),
- headerheight = head.outerHeight() + filter.outerHeight();
-
- $.mobile.window.on( "throttledresize", function() {
- $( "#sorter" ).height( $.mobile.window.height() - headerheight - 20 ).css( "top", headerheight + 18 );
- });
-
- $( "#sorter" ).height( $.mobile.window.height() - headerheight - 20 ).css( "top", headerheight + 18 );
-
- $.mobile.window.scroll( function( e ) {
- var headTop = $(window).scrollTop();
-
- if( headTop < headerheight && headTop > 0 ) {
- $( "#sorter" ).css({
- "top": headerheight + 15 - headTop,
- "height": $.mobile.window.height() - headerheight - 20
- });
- } else if ( headTop >= headerheight && headTop > 0 && parseInt( headTop + $.mobile.window.height( )) < parseInt( foot.offset().top ) ) {
- $( "#sorter" ).css({
- "top": "15px",
- "height": $.mobile.window.height()
- });
- $("#sorter li").height( "3.60%" );
- } else if ( parseInt( headTop + $.mobile.window.height() ) >= parseInt( foot.offset().top ) && parseInt( headTop + $.mobile.window.height() ) <= parseInt( foot.offset().top ) + foot.height() ) {
- $( "#sorter" ).css({
- "top": "15px",
- "height": $.mobile.window.height() - ( parseInt( headTop + $.mobile.window.height() ) - parseInt( foot.offset().top ) + 8 )
- });
- } else if( parseInt( headTop + $.mobile.window.height() ) >= parseInt( foot.offset().top ) ) {
- $( "#sorter" ).css({
- "top": "15px"
- });
- } else {
- $( "#sorter" ).css( "top", headerheight + 15 );
- }
- });
- $( "#sorter li" ).click( function() {
- var top,
- letter = $( this ).text(),
- divider = $( "#sortedList" ).find( "li.ui-li-divider:contains(" + letter + ")" );
-
- if ( divider.length > 0 ) {
- top = divider.offset().top;
- $.mobile.silentScroll( top );
- } else {
- return false;
- }
- });
-
- $( "#sorter li" ).hover(function() {
- $( this ).addClass( "ui-btn-up-b" ).removeClass( "ui-btn-up-c" );
- }, function() {
- $( this ).removeClass( "ui-btn-up-b" ).addClass( "ui-btn-up-c" );
- });
- });
|