2012-08-23 4 views
0

스크롤 막대를 jQuery custom content scroller과 함께 사용해 보았지만 약간의 문제가 있습니다. 정확히 내가이 태그 (일부 게시물), 그래서 내 문제는 데이터베이스에 데이터를 보내는 아약스를 사용하고 그것도 작동하지만, 데이터를 추가 할 때 데이터를 검색 해요 div 태그를 다 했어. div 태그에서 스크롤러는 크기가 고정되어 있고 갱신 중이 아닙니다 (페이지를 새로 고칠 때만 갱신). ajax를 사용하여 데이터를 추가 할 때 스크롤 막대 크기를 어떻게 갱신 할 수 있습니까? 또한 끝에서 스크롤 막대를 고칠 수있는 방법을 이해할 수 없습니까? pls이 문제에 대해 매우 혼란스럽게 도와주세요, 감사합니다 :)jQuery 사용자 정의 컨텐츠 스크롤러 스크롤

추신 : 감사합니다. 여기 너무 http://manos.malihu.gr/jquery-custom-content-scroller

는 UPDATE이 코드에서

$.ajax({ 
       url: "ajax/posting.php", 
       type: "POST", 
       data: {send_post: "Send", user_id: "<?php echo $userArr[0]; ?>", user_name: "<?php echo $userArr[2] . " " . $userArr[3]; ?>", msg: $("#post").val()}, 
       complete: function(){ 
        $("#post").val(""); 
       }, 
       success: function(result){ 
        $.ajax({ 
         url: "ajax/posting.php", 
         type: "POST", 
         data: {renew_posts: "Yes",admin: "<?php echo $userArr[1]; ?>",owner: "<?php echo $userArr[0]; ?>"}, 
         success: function(renewed_data){ 
          $("#chat_tb").html(renewed_data); 
          (function($){$(window).load(function(){$(".post_container").mCustomScrollbar({ 
           scrollButtons:{enable:true,scrollSpeed: 40} 
          });});})(jQuery); 
         } 
        }); 
       } 
      }); 

은이 놀라운 데이터베이스에 데이터를 전송 한 후 mCustomScrollbar() 콜백 내에서 기능을 업데이트하는 방법

답변

1

이 봐 홈 페이지를 플러그인입니다 Fluid scrollbar demo.

편집

이 작품은 아약스 요청 후 .mCustomScrollbar() -functon를 다시 초기화하려고하지 그 경우.

편집 2

그냥 시도 : 나 자신에게이 페이지 만 게시 질문을 게시 한

$.ajax({ 
    url: "ajax/posting.php", 
    type: "POST", 
    data: { 
     send_post: "Send", 
     user_id: "<?php echo $userArr[0]; ?>", 
     user_name: "<?php echo $userArr[2] . "" . $userArr[3]; ?>", 
     msg: $("#post").val() 
    }, 
    complete: function() { 
     $("#post").val(""); 
    }, 
    success: function(result) { 
     $.ajax({ 
      url: "ajax/posting.php", 
      type: "POST", 
      data: { 
       renew_posts: "Yes", 
       admin: "<?php echo $userArr[1]; ?>", 
       owner: "<?php echo $userArr[0]; ?>" 
      }, 
      success: function(renewed_data) { 
       $("#chat_tb").html(renewed_data); 
       $(".post_container").mCustomScrollbar({ 
        scrollButtons: { 
         enable: true, 
         scrollSpeed: 40 
        } 
       }); 
      } 
     }); 
    } 
});​ 
+0

있기 때문에 withing에 아약스의 성공을 작성해야합니다 – tnanoba

+0

그렇게하는 방법을 이해할 수 없다 스크립트 예? – tnanoba

+0

또한 문서를 읽었지만 기본적으로 끝까지 수정하는 방법을 이해할 수 없다고 생각합니다. 가능합니까? – tnanoba

관련 문제