应该能帮到你一点。
$(document).ready(function () {
//set up vars
var slider = $('#slider');
var firstImage = $('#slider img:first');
var lastImage = $('#slider img:last');
//Take them out of the gallery
firstImage.remove();
lastImage.remove();
//run photo gallery stuff
//Now add images back in
slider.prepend(firstImage);
slider.append(lastImage);
});
编辑
$(window).load(function() {
//set up vars
var slider = $('#slider');
var firstImage = $('#slider img:first');
var lastImage = $('#slider img:last');
//Take them out of the gallery
firstImage.remove();
lastImage.remove();
$('.slider').nivoSlider({
effect: 'slideInLeft', // Specify sets like: 'fold,fade,sliceDown'
slices: 15, // For slice animations
boxCols: 8, // For box animations
boxRows: 4, // For box animations
animSpeed: 500, // Slide transition speed
pauseTime: 3000, // How long each slide will show
startSlide: 1, // Set starting Slide (0 index)
controlNav: false, // 1,2,3... navigation
controlNavThumbs: false, // Use thumbnails for Control Nav
pauseOnHover: true, // Stop animation while hovering
manualAdvance: true, // Force manual transitions
prevText: 'Prev', // Prev directionNav text
nextText: 'Next', // Next directionNav text
randomStart: false, // Start on a random slide
directionNav:true,
directionNavHide:false,
afterLoad: function(){
//Now add images back in
slider.prepend(firstImage);
slider.append(lastImage);
} // Triggers when slider has loaded
});
});