2012-05-12 2 views
0

현재이 이미지 갤러리를 jQuery 도구로 가져 와서 페이딩 대신 슬라이딩 갤러리를 전환하려고합니다. 축소판 그림과 jQuery 도구 갤러리 페이드 대신 슬라이드가 필요합니다.

http://jquerytools.org/demos/scrollable/gallery.html

은 내가 그 일에 대해 갈 얼마나 궁금했다.

$(".items img").click(function() { 
// see if same thumb is being clicked 
if ($(this).hasClass("active")) { return; } 

// calclulate large image's URL based on the thumbnail URL (flickr specific) 
var url = $(this).attr("src").replace("_t", ""); 

// get handle to element that wraps the image and make it semi-transparent 
var wrap = $("#image_wrap").fadeTo("medium", 0.5); 

// the large image from www.flickr.com 
var img = new Image(); 


// call this function after it's loaded 
img.onload = function() { 

    // make wrapper fully visible 
    wrap.fadeTo("fast", 1); 

    // change the image 
    wrap.find("img").attr("src", url); 

}; 

// begin loading the image from www.flickr.com 
img.src = url; 

// activate item 
$(".items img").removeClass("active"); 
$(this).addClass("active"); 

// when page loads simulate a "click" on the first image 
}).filter(":first").click(); 

답변

0

당신은 다음 이벤트 중 하나를 사용할 수 있습니다,

$(<element>).slideIn(); // display image 
$(<element>).slideOut(); //remove image 
0

var wrap = $("#image_wrap").animate("width", 0);

시도
관련 문제