Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Anythingslider] Center slideimage Re: [Anythingslider] Center slideimage

#96924
Mottie
Member

Derp!

I’m sorry, I’ve been trying to catch up with all of my emails and I guess I totally spaced on this one LOL. Anyway, yes it is possible… just add the image as a centered background. Here is a demo (resize the result window to see it work), and the code:

HTML








CSS

#wrapper {
width: 100%;
height: 300px;
}
#slider .panel1 { background: url(http://placekitten.com/800/300) no-repeat center center; }
#slider .panel2 { background: url(http://placehold.it/800x300) no-repeat center center; }
#slider .panel3 { background: url(http://placedog.com/800/300) no-repeat center center; }
#slider .panel4 { background: url(http://dummyimage.com/800x300/000/fff.jpg) no-repeat center center; }

Script

$(function(){
$('#slider').anythingSlider({
// If true, the entire slider will expand to fit the parent element
expand: true
});
});‚Äč