2010-12-16 12 views
0

通常のブラウザでは固定ヘッダーを使用できるようにするjqueryコードがあります。したがって、デフォルトでは、ヘッダーの内容が表示されます。そのヘッダーをスクロールすると、スクロールするときにそのまま残ります。問題はそれがiPadのために働いていないということです。誰かがコードを見て、iPadでこの作業をするために変更できるものがあるかどうかを確認できますか?jqueryを使用してipadの固定コントロールバーを作成する

// Fixed control bar 
     var controlBar = $('#control-bar'); 
     if (controlBar.length > 0) 
     { 
      var cbPlaceHolder = controlBar.after('<div id="cb-place-holder" style="height:'+controlBar.outerHeight()+'px"></div>').next(); 

      // Effect 
      controlBar.hover(function() 
      { 
       if ($(this).hasClass('fixed')) 
       { 
        $(this).stop(true).fadeTo('fast', 1); 
       } 

      }, function() 
      { 
       if ($(this).hasClass('fixed')) 
       { 
        $(this).stop(true).fadeTo('fast', 1); 
       } 
      }); 

      // Listener 
      $(window).scroll(function() 
      { 
       // Check top position 
       var controlBarPos = controlBar.hasClass('fixed') ? cbPlaceHolder.offset().top : controlBar.offset().top; 

       if ($(window).scrollTop() > controlBarPos) 
       { 
        if (!controlBar.hasClass('fixed')) 
        { 
         cbPlaceHolder.height(controlBar.outerHeight()).show(); 
         controlBar.addClass('fixed').stop(true).fadeTo('slow', 1); 

         // Notifications 
         $('#notifications').animate({'top': controlBar.outerHeight()+notificationsTop}); 
        } 
       } 
       else 
       { 
        if (controlBar.hasClass('fixed')) 
        { 
         cbPlaceHolder.hide(); 
         controlBar.removeClass('fixed').stop(true).fadeTo('fast', 1, function() 
         { 
          // Required for IE 
          $(this).css('filter', ''); 
         }); 

         // Notifications 
         $('#notifications').animate({'top': notificationsTop}); 
        } 
       } 
      }).trigger('scroll'); 
     } 
+0

誰でもお手伝いできますか?これは、iPadのSafariブラウザで動作させるために誰かを取得するための支払いが必要ですか? – John

答えて

0

この回答は、賢者タッチのような別の解決策を使用していました。

関連する問題