Ryan

MultiSlide for Mootools

February 24, 2009 by Ryan in Code, Mootools


Overview

MultiSlide is a Mootools class that will group multiple slide effects together and allow you to slide them all in or out at one time. MultiSlide will also allow you to retain individual control over each slide and it contains several callback events for easier integration into your UI.

Current Version: 1.0

Source is hosted at GitHub

Features

  • Built on Mootools 1.2 and weighs in at 4kb (uncompressed)
  • Opening or closing of multiple slides with one button
  • Retains individual control over each separate slide
  • Uses customizable CSS classes for hooks, so that no additional markup is needed
  • Several callback events for custom UI controls
  • Transition speed and type are configurable

Demo

  • Basic Example
  • Example with a few more options
    • How To Use It

      The basic structure should closely follow the following structure when building multiple slides. You can have as many of the “ms_container’s” as you need and all are controlled by the top two elements. Consider each of the following sections as an HTML element with the class name as shown. Please note that these are just the default class names and can be replaced with your own custom ones to reduce markup.
      multislide
      The standard way to initialize MultiSlide is to call the class and pass in the CSS class name of the element that wraps each slide. In this case it would be:
      var multislide = new multislide('ms_container');
      You can also call the “expand all” and “collapse all” methods from your javascript by calling:
      multilside.expand_all();
      multilside.collapse_all();

      Please read the documentation below and look at the demos to see how to further customize the MultiSlide class.

      Documentation

      Syntax

      new multislide(container_class [, options]);

      Arguments

      • container_class – (mixed) A string of the CSS class name that wraps each slide instance
      • options – (object, optional) key/value set of options

      Options

      • slide_duration – (number) duration (in milliseconds) of the slide; defaults to 300
      • slide_transition – (string) transition that the slide should use; defaults to ‘sine:in:out’
      • class_expand_all – (string) CSS class name that is applied to the element that will expand all the slides; defaults to ‘expand_all’
      • class_collapse_all – (string) CSS class name that is applied to the element that will collapse all the slides; defaults to ‘collapse_all’
      • class_toggler – (string) CSS class name that is applied to the element that will toggle the individual slide; defaults to ‘ms_toggler’
      • class_expander – (string) CSS class name that is applied to the element that will be the slide; defaults to ‘ms_expander’

      Methods

      • expand_all – Used to expand all the slides at one time
      • collapse_all – Used to collapse all the slides at one time

      Custom Events

      • onExpand – Fired anytime a single slide in the group is exapnded by it’s toggler. Passes the toggler element that was clicked back to the event to be able to make UI changes.
      • onCollapse – Fired anytime a single slide in the group is collapsed by it’s toggler. Passes the toggler element that was clicked back to the event to be able to make UI changes.
      • onExpand_all – Fired anytime the “exapand all” runs
      • onCollapse_all – Fired anytime the “collapse all” runs
7 Comments

Great little script you have here, I am going to implement it and see how it goes.

March 1, 2009 by Paul Thomas

Awesome script. So easy to implement. Keep up the work.

March 6, 2009 by Pasquale Scerno

Hello,

It’s possible to have two (or more) multislides in a single page?

Thanks!

March 23, 2009 by Sergi

Sergi,

Sure is. When you do:
var multislide = new multislide(‘ms_container’);

you are grouping all the slides with the class “ms_container” together. So you can just as easily change that class name to group another set.

var multislide = new multislide(‘ms_container’);
var multislide2 = new multislide(‘ms_container2′);

March 23, 2009 by Ryan

Oh, it’s so easy…

Thank you very much Ryan!

March 24, 2009 by Sergi

I also want to have two (or more) multislides in a single page but I do not understand your comment above.

Could you possibly show the full code modification or set up a demo page to show how to do it?

I am a noob (obviously), at mootools so please bear that in mind.

May 14, 2009 by Dan

great post…it is useful fo me alot…Thank you very much …

May 1, 2010 by Telugu Cinema
Comment Preview

September 18, 2008 by
Leave a comment

Name: *

Email: * (will never be displayed)

Website:

Comments: *

* - Required