試試這個:
創建映像陣列:
var homeImages = [
{image : 'img/1.jpg', title : '', thumb : 'img/thumbs/1.jpg', url : ''},
{image : 'img/2.jpg', title : '', thumb : 'img/thumbs/2.jpg', url : ''},
{image : 'img/3.jpg', title : '', thumb : 'img/thumbs/3.jpg', url : ''},
];
var home = $.makeArray(homeImages);
var secondImages = [
{image : 'img/4.jpg', title : '', thumb : 'img/thumbs/4.jpg', url : ''},
{image : 'img/5.jpg', title : '', thumb : 'img/thumbs/5.jpg', url : ''},
{image : 'img/6.jpg', title : '', thumb : 'img/thumbs/6.jpg', url : ''},
];
var second = $.makeArray(secondImages);
然後設置主頁Suppersize幻燈片
$.supersized({
// Functionality
slideshow : 1, // Slideshow on/off
autoplay : 1, // Slideshow starts playing automatically
start_slide : 0, // Start slide (0 is random)
stop_loop : 0, // Pauses slideshow on last slide
random : 0, // Randomize slide order (Ignores start slide)
slide_interval : 3000, // Length between transitions
transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
transition_speed : 500, // Speed of transition
new_window : 1, // Image links open in new window/tab
pause_hover : 0, // Pause slideshow on hover
keyboard_nav : 1, // Keyboard navigation on/off
performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
image_protect : 1, // Disables image dragging and right click with Javascript
// Size & Position
min_width : 0, // Min width allowed (in pixels)
min_height : 0, // Min height allowed (in pixels)
vertical_center : 1, // Vertically center background
horizontal_center : 1, // Horizontally center background
fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions)
fit_portrait : 0, // Portrait images will not exceed browser height
fit_landscape : 0, // Landscape images will not exceed browser width
// Components
slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank')
thumb_links : 1, // Individual thumb links for each slide
thumbnail_navigation : 0, // Thumbnail navigation
slides : home // Using the home Image array we created
});
然後創建其餘的超級大小功能:
function resetSupersized(arr)
{
$("#play-button").empty().remove();
$("#thumb-list").empty().remove();
$("#thumb-back").empty().remove();
$("#thumb-forward").empty().remove();
$("#supersized").fadeOut('fast', function()
{
$('#supersized-loader').empty().remove();
$('#supersized').empty().remove();
$('#hzDownscaled').empty().remove();
$('body').append('<div id="supersized-loader"></div><ul id="supersized"></ul>');
// Animation complete.
$("#tray-button").fadeIn();
$('#thumb-tray').html('<div id="thumb-back"></div><div id="thumb-forward"></div>');
$.supersized({
// Functionality
slideshow : 1, // Slideshow on/off
autoplay : 1, // Slideshow starts playing automatically
start_slide : 1, // Start slide (0 is random)
stop_loop : 0, // Pauses slideshow on last slide
random : 0, // Randomize slide order (Ignores start slide)
slide_interval : 3000, // Length between transitions
transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
transition_speed : 500, // Speed of transition
new_window : 1, // Image links open in new window/tab
pause_hover : 0, // Pause slideshow on hover
keyboard_nav : 1, // Keyboard navigation on/off
performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
image_protect : 1, // Disables image dragging and right click with Javascript
// Size & Position
min_width : 0, // Min width allowed (in pixels)
min_height : 0, // Min height allowed (in pixels)
vertical_center : 1, // Vertically center background
horizontal_center : 1, // Horizontally center background
fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions)
fit_portrait : 0, // Portrait images will not exceed browser height
fit_landscape : 0, // Landscape images will not exceed browser width
// Components
slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank')
thumb_links : 1, // Individual thumb links for each slide
thumbnail_navigation: 0, // Thumbnail navigation
slides : arr
});
});
}
然後調用從任何你想和你想使用的陣列功能,...即的onClick();
resetSupersized(second);
希望這有助於;-)
編輯:我曾與此唯一的問題是,它搞砸了過渡速度....我還在努力工作這個問題了!
優秀的解決方案。當你構建一個精心設計的解決方案時,它會相當激烈,OP不會選擇它 – 2013-03-22 17:06:02