0

我目前正在尝试在 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();
4

2 回答 2

0

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

于 2012-05-12T17:06:17.317 回答
0

您可以使用以下事件之一,

 $(<element>).slideIn(); // display image
 $(<element>).slideOut(); //remove image
于 2012-05-12T16:29:09.133 回答