2010-01-15 5 views
1

저는 SmoothScrollDiv와 Galleria ..의 통합을 위해 작업 중입니다 - 축소판을 스크롤합니다. 여기 내 코드의SmoothDivScroll 플러그인과 함께 Galleria 통합

데모 : 나는 브라우저 창 크기가 조정되는 문제가 http://test.kinkylemon.nl/sym/galleria/demo3.htm

, SmoothScrollDiv는 더 이상 올바르게 DOM에 바인딩 ... 나 같은 일입니다! - 작동이 멈 춥니 다.

페이지로드시 IE6에서도 유사한 버그가 발생합니다 (빈 캐시 포함).

그래서 질문 A. 어떻게 든 bind() 또는 live()를 사용해야합니까? 이 문제입니다 - http://maaki.com/thomas/SmoothDivScroll/ :

$(function($) { $('ul#gallery').galleria({ 
      history : false, // activates the history object for bookmarking, back-button etc. 
      clickNext : true, // helper for making the image clickable 
      insert : '#galleriaContentBox', // the containing selector for our main image 
      onImage : function(image,caption,thumb) { // let's add some image effects for demonstration purposes 

       // fade in the image & caption 
       if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1)) { // FF/Win fades large images terribly slow 
        image.css('display','none').fadeIn(1000); 
       } 

       // fetch the thumbnail container 
       var _li = thumb.parents('li'); 

       // fade out inactive thumbnail 
       _li.siblings().children('img.selected').fadeTo(500,0.3); 

       // fade in active thumbnail 
       thumb.fadeTo('fast',1).addClass('selected'); 

       // this will add a class to landscape images allowing extra margin 
       if (image.height() < image.width()) { 
        $('#galleriaContentBox').addClass('landscape'); 
       } else { 
        $('#galleriaContentBox').removeClass('landscape'); 
       } 

      }, 
      onThumb : function(thumb) { // thumbnail effects goes here 

       // fetch the thumbnail container 
       var _li = thumb.parents('li'); 

       // if thumbnail is active, fade all the way. 
       var _fadeTo = _li.is('.active') ? '1' : '0.3'; 

       // fade in the thumbnail when finnished loading 
       thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500); 

       // hover effects 
       thumb.hover(
        function() { thumb.fadeTo('fast',1); }, 
        function() { _li.not('.active').children('img').fadeTo('fast',0.3); } // don't fade out if the parent is active 
       ) 
      } 
     }); 
    }); 


    $(document).ready(function() { 
     //$(function() { 
      $("div#smallScroller").smoothDivScroll({ 
       scrollableArea: "ul.scrollableArea", //The identifier of the actual element that is scrolled left or right. 
       mouseDownSpeedBooster: 2, 
       scrollingSpeed: 25, 
       autoScrollDirection: 'endlessloop' 
       //visibleHotSpots: 'always' 
      }); 
     //}); 
    }); 

.. 그리고 질문 B. ... 난 단지에서 다음 보았다? - 다른 플러그인을 사용해야합니까? ..maybe

는 "부드러운 사업부 스크롤 스크롤 영역을 다시 계산하지 않습니다. 재 계산을 수행하는 사용자가 브라우저 창 크기를 조절 첫째 때. 을 라는 함수 거기에 소스 코드를 보면"jCarousel

에 다시 "windowIsResized가 이것은 사용자가 브라우저 창 크기를 조정할 때 발생하며 스크롤되는 영역의 너비를 너비로 적절하게 다시 계산합니다.이 코드는 스크롤러를 "다시 초기화"하는 일반적인 함수로 다시 작성해야합니다.이 함수는 다음과 같아야합니다. 공용 API의 일부인 이므로 AJAX 콘텐츠로드가 완료된 후 개발자가 호출 할 수 있습니다. " 문제가 SmoothDivScroll 플러그인이 windowIsResize 기능

내가 jCarousel과 재건에 대한 업데이트를 필요로했다 - -

답변

0

질문 B 오른쪽 하나 좋은 작동합니다. 여전히 SmoothDivScroll로 구현 된 마우스 오버 기능을 복제하는 방법을 찾고 있습니다. jCarousel에서는 불가능합니다.