From our sponsor: Ready to show your plugin skills? Enter the Penpot Plugins Contest (Nov 15-Dec 15) to win cash prizes!
With the CSS 3D Transforms we can create some neat effects by transforming elements in three-dimensional space. Slicebox makes use of the 3D transforms properties and allows different kind of effects. The main idea is to create three-dimensional image slices that will rotate and reveal the next image as another side of the 3D object. In case the browser does not support 3D transforms, a simple slider will be used as fallback.
Please note that you can only see the cool 3D effect of Slicebox in a browser that supports those CSS3 properties.
The images used in the demos are by ND Strupler. They are licensed under the Attribution 2.0 Generic (CC BY 2.0).
Tiny break: 📬 Want to stay up to date with frontend and trends in web design? Subscribe and get our Collective newsletter twice a tweek.
Usage
In order to use Slicebox, put your images in an unordered list with the class “sb-slider”:
<ul id="sb-slider" class="sb-slider"> <li> <a href="#" target="_blank"> <img src="images/1.jpg" alt="image1"/> </a> <div class="sb-description"> <h3>Creative Lifesaver</h3> </div> </li> <li> <img src="images/2.jpg" alt="image2"/> <div class="sb-description"> <h3>...</h3> </div> </li> <li><!-- ... --></li> <!-- ... --> </ul>
You can use the div with the class “sb-description” to add any kind of description for the respective image. As shown in this example, you can also add an anchor around the image.
Then you can call the plugin with
$('#sb-slider').slicebox();
Options
Slicebox comes with a set of options that you can adjust for various types of effects:
$.Slicebox.defaults = { // (v)ertical, (h)orizontal or (r)andom orientation : 'v', // perspective value perspective : 1200, // number of slices / cuboids // needs to be an odd number 15 => number > 0 (if you want the limit higher, // change the _validate function). cuboidsCount : 5, // if true then the number of slices / cuboids is going to be random (cuboidsCount is overwitten) cuboidsRandom : false, // the range of possible number of cuboids if cuboidsRandom is true // it is strongly recommended that you do not set a very large number :) maxCuboidsCount : 5, // each cuboid will move x pixels left / top (depending on orientation). // The middle cuboid doesn't move. the middle cuboid's neighbors will // move disperseFactor pixels disperseFactor : 0, // color of the hidden sides colorHiddenSides : '#222', // the animation will start from left to right. The left most // cuboid will be the first one to rotate // this is the interval between each rotation in ms sequentialFactor : 150, // animation speed // this is the speed that takes "1" cuboid to rotate speed : 600, // transition easing easing : 'ease', // if true the slicebox will start the animation automatically autoplay : false, // time (ms) between each rotation, if autoplay is true interval: 3000, // the fallback will just fade out / fade in the items // this is the time fr the fade effect fallbackFadeSpeed : 300, // callbacks onBeforeChange : function( position ) { return false; }, onAfterChange : function( position ) { return false; } };
Check out each example and you will see how to create different behaviors with the options.
Hope you find it useful, feedback is welcome!
The Slider looks great!!!
I´m trying to incorporate it into a WordPress design that I am working on, however I cannot get it to work. Is there anyone else having the same problem? I’ve used the php for referring to current stylesheet….
Hi, first congrats on the great work! It really is cool. Second, I was wondering, if there is an easy adaptation to content elements, like div’s? Any thoughts on that? I was trying to adapt the find(‘img’), but it didn’t work. But I was not trying very hard 😉 Thank you
nice and smooth. Thanks 🙂
Man! I got it working in WP now and it´s AMAZING! Great job!!!!
nice slider but don’t work on chrome 13.0.782
Great work!
I like it.
Thanks
Nice, however, unsupported system must enable “Override software rendering list” feature on about:flags page when using Chrome.
It does not work on Chrome 13.0.782.220
Stop posting it doesn’t work in Chrome 13.0.782.220. It’s been posted over and over… we get it.
Works great for me in Chrome 13.0.782.220 m
Great work Pedro. The fallback works perfectly even in IE6.
What’s the license under which you’re releasing Slicebox?
Hello!
Great work!!
Is it possible to keep the title on however without pressing on it all the time?
Thank you so much!
Eric
Fantastic! The same effect I could see with Banner Rotator by Digicrafts but without Flash. Great work
Awesome… thanks a ton.
btw… sorry if i sound noob but how do i set it to autoplay?
Thanks…
Incredible coooool image slider I’ve ever seen.
Thanks so much for your great work!
Grande, ottimo lavoro!
this is so freakin’ awesome, I’ll definitely use it in some future project. thank you.
hey, you guys are doing a great job. keep it up.
very nice. thanks!
is it posible to give link to images ? it should!
Hello, I’m having problems with latest Chrome version in Windows… the transition is getting messed and when scrolling up or down image disappear
Wow, what a great slides… thank you Pedro
Hi Pedro,
Thank you for sharing a fantastic gallery. It really is a stunning piece of work.
I’m a web designer and I am always on the lookout for creative ideas.
It’s a real shame it will not work on all browsers. I’m using Chrome 14.0.835.202 m and it works perfectly.
On a positive note, your work just goes to show we all need to upgrade our browsers!
Keep up the great work.
Best regards
Sanjay
That was really nice 🙂 Thanks for sharing.
Very cool effect 🙂 I m trying to use the slider in a website and observed that having a text input field focused while using the slider creating ‘black’ irregular shapes over the images and so 3D effects. Is this a bug with Chrome or the script? (using Chrome 14, canary 16)
Thanks
You can see the said effect here: http://imageshack.us/photo/my-images/833/clipboard02sc.jpg/
Hi, great job, one question though, is it possible to click the images?
Thanks
im new to this whole thing can any1 give me a tutrial or something that can help me insert this
Very cool but having issue with IE 9 & 10 . Nothing show up. Ie 8 and 7 looks ok
LOVE IT!!!!!!! But it doesn’t work on Explorer. Is there anything I can do to fix that?
excellent but I try to do and when I see it is static in chrome
because it could be??
How can I reduce the size of the images? I can’t find pre-set value for the images anywhere. I know they have to be 700X420 but I can’t figure out how to change it.
Hi there!
It looks absolutely awesome!
However, i’m having trouble using the slicebox in IE 9.
The slicebox doesn’t show at all. Sometimes it shows after refreshing a couple of times.
Could you please look in to that?
Thanks in advance.
Erik.
great stuff Pedro! thanks for sharing 🙂
is there any way to add apple like pagination? just to show visitors on which slide there at.
That is awesome, well done!
Yeah this is AWESOME !
… too bad it’s not working in IE… 🙁
** ohh sorry, it works with IE, when you set this in your script:
if( !Modernizr.csstransforms3d ) {
$(‘#sb-note’).show();
$(‘#sb-examples > li:gt(2)’).remove();
}
yeeeeeah very cool 🙂 So… now we’ll wait for the other browsers (without Chrome and Safari) to support CSS3 3D
Very cool! Just have to put a small snippet of text under the slider when integrating it. “10 times cooler in Safari or Chrome”
Thank you for sharing such an amazing image slider. Very impressive work.
P.S. was wondering are there any option to disable the info and play button at the bottom right corner ? or autoplay setting to false … etc options. Instead of manipulating the CSS 😀 cheers
btw, i tried to integrate slicebox with lightbox, i added a link outside but link wasn’t clickable. Any ideas ? 😀
Thanks
Sorry, the autoplay settings are available in tutorial on top, didn’t saw that earlier
hi there! where do you change the options that are writen in the tutorial above…
thanks!
Hello there, awesome slider! But, i have same question as John (Nov. 6.). How to change size of slider? I need it for images which size are 760×389. Its possible to change it? And another question. When I edited “jquery.slicebox.js”- “slideshow : true, // if true the box will be rotating automatically.” its not working and i dont know why :(. Thanks for answer.
Jakub
@Jakob make sure you aren’t pointing to the .min.js file instead of the one you altered. That setting change works just fine for me.
——–
I thought I had implemented the plugin incorrectly, but it turns out the slide disappears if there is an <a> tag in the div.
These sliders are almost always used for “feature” content, anyway to allow <a> tags? Would REALLY be useful!
Thanks Pedro
Tim Bouchard +1
<a> is in the div and slider is gone
Need Fix :)))
That’s really nice. But with NO JS you don’t get anything. If this had a NO JS fallback this thing would be even more spectacular.
Great job!!! I also need to link each slide… and thats not working… how do we get each slider to carry a hyperlink?
@superkalo the slide doesn’t work also with your hack.. there is another way to make it work with IE ? (we try to use reload functions but we prefer use another solution)
Thats.. Wow!!! I really liked it.. Keep it up…
YJ
Bhutan
Getting a bunch of black lines through the bottom of the image. See here: http://www.freeimagehosting.net/newuploads/ae37a.jpg, can’t figure out why. Took all my extra site code out, but still doesn’t work 🙁
Thanks, very nice and useful.