How to: Creating a slideshow with Noobslide
Posted by Jean-Baptiste Jung on Jun 23, 2008 in Web development • 20 commentsNoobslide is a Mootools based slideshow script that allows you to slide images and text with eye-candy transitions effects. The only problem with Noobslide is its lack of documentation, which make it hard to understand if you’re new to javascript. Here is a tutorial for beginners with Noobslide to create your first slideshow.
Let's starts with a screenshot to see what you'll be able to do with Noobslide:

If you're still not convinced, or want to see a live demo of the script (Which is surely better for a slideshow
) you'll find some very nice exemples here.
As we can see on the demo, Noobslide can be used for many diffrerent slideshow templates. Of course, you can customize it to perfecty fits your needs.
For this tutorial, I chose to explain the first exemple of the demo. It's both the simpler and the most common.
We'll of course start by downloading Noobslide zip archive.
Once unzipped, the archive contains some pretty exemple images, the javascripts, css and the Mootools framework.
Let's including all this beautiful people in the head part of our html document:
<link rel="stylesheet" href="_web.css" type="text/css" media="screen" /> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <script type="text/javascript" src="_mootools.js"></script> <script type="text/javascript" src="_class.noobSlide.js"></script>
In the body part, we'll create our content:
<h2>Slideshow</h2> <div class="sample"> <div class="mask1"> <div id="box1"> <span><img src="img1.jpg" alt="Photo" /></span> <span><img src="img2.jpg" alt="Photo" /></span> <span><img src="img3.jpg" alt="Photo" /></span> <span><img src="img4.jpg" alt="Photo" /></span> <span><img src="img5.jpg" alt="Photo" /></span> <span><img src="img6.jpg" alt="Photo" /></span> <span><img src="img7.jpg" alt="Photo" /></span> <span><img src="img8.jpg" alt="Photo" /></span> </div> </div> </div>
Here's for the content. We created three divs: sample, box1 and mask1.
For semantic reasons, I'd prefer to use an unordered list (<li>), rather than this endless <span> list, but to be honnest with you, for now I just played around with the exemple provided by the author.
Last step: the javascript. It's now time to make our slideshow move. Add the following code to the head part of your html document, or even better in a separate .js file:
<script type="text/javascript">
window.addEvent('domready',function(){
var hs1 = new noobSlide({
box: $('box1'),
items: [1,2,3,4],
size: 480,
autoPlay: true
});
})
</script>
Let's have a look to this code snippet:
The window.addEvent() method will load this code when the browser had loaded the dom tree. It's a clear performance gain since we don't need to wait for the images to load before loading our script.
Then, we'll create an instance of the noobSlide class.
- box: The id of the main container. In our exemple, it is box1. Note that the dollar ($) is a Mootools shortcut to the document.getElementById() function.
- items: Number of steps from the beginning to the end of the slideshow.
- size: Slideshow width, in pixels.
- autoPlay: When set to true, this parameter allows noobSlide to slide automatically at regular intervals.
I will not speak about the css part of it: As this exemple uses the default ids and classes defined in the provided stylesheet, it will look like the online demo.
If you want to customize it, it's up to you
Conclusion
Really, I love this script, and had much fun testing it and writing this tutorial. So, I plan to write more tutorials like this one, like for exemple studiying some other exemples from the demo website or noobslide integration in Wordpress.
Interested? Don't hesitate to tell me what you'd like to read!
Edit (07/14/2008): Another noobslide tutorial is available here.

















Nice tutorial! Don’t hesitate to write more about it, hehe
not working!
Weird, I re-tested the code and it do works like a charm.
Nice tutorial, thanks.
Worked perfectly for me.
Thanks for writing this. If you have some time Sample #6 has been giving me some trouble and would love to see an explanation.
Sample6 shall be a good idea for a new tutorial. Thank you for contributing.
Don’t forget to suscribe to our rss feed, so you’ll be sure not to miss the tutorial when I’ll write it
This has been a real help thanks, 2 questions tho:
1) Can u change the speeds i.e. per slide / slide time ?
2) Is there a way to join the first slide onto the end of the last. i.e. keeping going with out the rush back at the end?
Thanks heaps
You’re welcome.
1) The interval parameter allows you to set the duration of each slide, in milliseconds.
2) I never tried but I’m pretty sure it’s possible. I’ll let you know when I’ll have more info.
Btw, a new noobslide tutorial is on the way, so you should suscribe our rss feed to know when it will be available.
I’d like to use a combination of the samples on http://www.efectorelativo.net/laboratory/noobSlide/
I want to use sample 4 but with thumbnail images instead of text links [easy]. However i’d like each of the thumbnails to have a title layered over the top like the main images on sample 6.
Any ideas how to achieve this?
Hey thanks, all subscribed. Tryed to get sample 7 working but as soon as I remove any of the box divs from the other samples it falls over. But anyways I will wait keenly for the next tutorial.
Thanks again keep up good work.
@Dan: According to the onWalk method on sample6 script, the author injects title and paragraph by using javascript. I didn’t tried it, bt I think you can easily do the same thing on sample 4.
@Format6: Lucky you, I’m currently working on a tutorial for the sample 7. Hope it will be ready to be posted soon!
never mind. got it.
Hi, I’m working on Sample 5 and would like to know if there is a way to have a control that takes you all the way back to start, and another that fast-forwards to the last slide.
Thanks for your help and for providing this tutorial.
@Pam: I never studied Sample 5, but I’m pretty sure that you can do what you want. I’ll look at it and get back to you
Thanks… have you made any headway by chance? Beggars can’t be choosers and I know you must be very busy so let me know how I can contribute a few $$ to your cause.
Pam
@Pam: Sorry for the late reply. I studied a bit sample 5 but I can’t get it to work alone too. Really weird. I’ll keep you informed if I find the problem.
Hey there, I really enjoyed this tutorial. But I was just wondering.. how do I get more than one slide show on my page? I tried to figured it out myself.. but nothing seems to work. Anyone?
Nevermind people, Iv”e allready found out why it wasn’t working.