2011-04-05 7 views
1

플로팅 메뉴 플러그인이 있습니다. 다른 브라우저에서는 잘 작동하기 때문에 jQuery와 관련해 제가 열심히 노력하고 있습니다.하지만 Chrome에서는 페이지를 스크롤하는 대신 페이지를 스크롤하는 대신 앉아 있습니다. 위 또는 아래로 스크롤 :jQuery 부동 메뉴가 Chrome에서 작동하지 않습니다.

   // Cache :) 
      var fblb_cont = $("#fblb_cont"); 
      var fblb_main = $("#fblb_cont .fblb_main"); 
      var fblb_pos = $('#fblb_cont').position().top; 
      var float_easing = "easeOutQuint"; 

      // When the user scrolls 
      $(window).scroll(function() { 


       // Float our bar to correct page location 
       // Figure out how much to scroll 
       var scroll_factor = $(document).scrollTop(); 

       // Create our new scrollTo position    
       var newPos = (fblb_pos + scroll_factor); 

       // Check if the window height is within bounds 
       if($(window).height() < $("#fblb_cont").height()+$("#fblb_cont .fblb_main").height()){ 

        // Adjust where needed 
        fblb_cont.css("top", fblb_pos); 

       } else { 

        // Otherwise animate our scroll to the new position 
        $("#fblb_cont").stop().animate({top: newPos}, defaults.float_speed, float_easing); 

       } // End if 



      }); // End on scroll 

답변

0

이 시도 :

$("#fblb_cont").stop().animate({top: newPos + 'px'}, 
          defaults.float_speed, float_easing); 
관련 문제