Ferdinand.Slider

Setup

Ferdinand.Slider requires PrototypeJS >= 1.6.0.3 (prototypejs.org) and Scriptaculous Effects >= 1.8.2 (script.aculo.us). Include Javascript files:


In above example I am using google as source for Prototype and Scriptaculous but you can just as easily download both frameworks and serve them from your server.

After including javascript files you need to define container element for slider and making Ferdinand.Slider(id) call, like so:


Options

You can also configure Ferdinand.Slider with a bunch of options.

Option Description Default
effectDuration duration of title and excerpt scroll down and up in seconds 0.6
transitionDuration duration of image transition effect in seconds 0.6
timeout time to display one slide before going on next one (3500 = 3.5sec) 3500
opacity if you do not wish to use transparent png for title/excerpt background then set this to value of 0 for full transparency and 1 for no transparency (0.5 is 50% opacity) null
background if opacity is set to null then this is the place where you can set location of background image for title/excerpt images/background.png
loader path to loader animated gif images/ajax-loader.gif
next path to next button image images/next.png
previous path to previous button image images/previous.png
type doesn’t do anything yet, it is a placeholder for future releases json
url path to json source file callback.json
titleClass css class of the title title
excerptClass css class of excerpt tekst
containerClass css class of slider container ferdinand-slider

Example would be:

	slider = new Ferdinand.Slider('container_id', {
		effectDuration: 0.4,
		opacity: 0.5,
		timeout: 5000,
		excerptClass: 'comecssclass'
	});

Available Methods

To control Ferdinand.Slider from outside script/function you can use fallowing methods:

Testo za picu

Assuming you initialized Ferdinand Slider in variable “slider” like in example above.

Method Name Description
slider.Next() will skip to next slide in line
slider.Prev() will go back to previous slide
slider.Go(2) will go to third slide in the line. notice that even tho there is a number 2 in the method brackets slider will go to slide number 3. this is becouse first slide is considered to be number zero
slider.Pause() pause method will stop slider on current slide. using methods next, prev or go will init slider yet again
slider.CurrentSlide() returns(int) current slide number. note slide number 1 is 0 (zero) not 1 (one)
slider.SlideCount() returns(int) total slide count, as returned by json source.

Download

41 Responses to “Ferdinand.Slider”

  1. Justin Says:

    hey
    good job on the slider - looks great! Quick question; is it poss to install this within an HTML page. ie, I have a 460×300 frame where my images currently appear and I’d really like to install this instead…..
    cheers pal,
    Justin

  2. Vladimir Cvetic Says:

    Thanks Justin. Should be no problem to integrate it in frame.
    Simply include all javascript files in frame and you are good to go.

  3. S. Yugandhar Says:

    Super’b’

  4. volkan levent Says:

    Hello, perfect extension. But it doesnt work on IE7. Will you plan to correct it ?

    thanks

  5. Sven Rieke Says:

    This is the best image slider, like it much more than LightWindow, Spacegallery, zoomy, etc.

    But I have a problem: Would like to put it centred on my page (inside a DIV with align=center).
    The image is centred, but the text isn’t, so it will not fit any longer.

    It would be nice also to have at least a call in the sliders API to pause the image changes or to have a pause button integrated (like the next and prev).

  6. Vladimir Cvetic Says:

    @Sven Rieke
    Great idea for pause, will definitely implement it soon.

    As for centering I will check it out on monday and report back.

  7. Vladimir Cvetic Says:

    As promised, new version is out today, several new methods and number of fixes.
    I believe all IE problems should be ancient history.

    Oh yea, and stay tooned… there will proly be another extension release today, working title is Ferdinand.PhotoTag

  8. Vladimir Cvetic Says:

    @Sven Rieke
    As for the centering issue try this:

    It would require slider images to have fixed width.

  9. Fabio Says:

    Hello, congratulations for this script. I have a question:
    how can I make this slide gallery with dynamic php?

  10. Vladimir Cvetic Says:

    You can generate json with php

  11. Fabio Says:

    ok, but with extension .php?
    into option type JSON or php?

    tnx for all!!

  12. Vladimir Cvetic Says:

    Rename json file from callback.json to callback.php
    Leave type as it is, simply generate json output from your php script.

    You will need to change option url from callback.json to callback.php

  13. Fabio Says:

    Hi Vladimir,
    Sorry, but I have uploaded the original content of zip file into ftp at http://www.mariagabriellacosta.it/ferd/
    But not work!!!! :( :( :( :(

  14. Vladimir Cvetic Says:

    Consulting and installation services are charged by the hour or you could simply RTFM

  15. Fabio Says:

    Solved! I had a problem with server!
    Bye

  16. Fabio Says:

    Hello Vladimir,
    I have find a bug into method Slider.Prev(),
    I have solved this way:

    Prev: function () {
    // if current key is 1 disabled this method
    if(this.current_key!=0){
    this.Go(this.current_key-1);
    }
    }

  17. Chris Says:

    I’ve got it mostly working, the problem is it’s crashing IE6, and it’s spitting out constant errors every second or so. I noticed it’s doing it on your site as well. The error is:

    “Warning: Error in parsing value for property ‘width’. Declaration dropped.
    Source File: http://ferdinand.rs/javascript/ferdinandslider#
    Line: 0″

    After a while, the page starts dragging down the browser. Any suggestions?

    Otherwise, this is a great function! ;-)

  18. Chris Says:

    Well, I figured out the IE6 crash. It was the use of an IE PNG transparency fix that was causing a conflict. :-(

    I’m using IE PNG Fix from TwinHelix, located here: http://www.twinhelix.com/css/iepngfix/

    Any suggestions?

  19. Nicolas Says:

    Hello Vladimir,How difficult would it be to have a option to put the title and excerpt at the image’s bottom?

    Thank for this Extension

  20. Vladimir Cvetic Says:

    It’s not that all that hard, will consider it during next update.

  21. Tyler Says:

    Is a PHP server required for this to execute? I’ve tried testing on ASP, ColdFusion, and PHP servers and the only one I’ve been successful on is my PHP server (works wonderfully there, btw). If you can shed any light on this, I’d much appreciate it. I’m really looking to implement this on an ASP server, however no matter how I go about I’m not having much luck. Thanks.

  22. Vladimir Cvetic Says:

    It doesn’t matter what server you are running.
    For asp or cfm servers simply rename callback.json to callback.asp/.cfm.

  23. Jason Says:

    Nice work dude! I seriously second Nicolas request.

  24. Kontaktschmied Says:

    Thanx for your job.
    An other, similar solution is: http://www.wappler.eu/swgallery/

    Best regards

    Rainer

  25. Massimo Marolda Says:

    _I_t’s possible to remove captions?

  26. Roxbourne Says:

    I like this a lot! I’ve used it on my website here: http://www.roxbourne.com.

    Is there a way to remove the left and right feature altogether? I just want it as a slideshow.

  27. joseph Says:

    Hi,

    I have installed your script, but after a couple of minutes slows the browser.
    I checked with Firebug and I have seen a infinity loop of code before html tag

    Thanx

  28. Sullivan Couto Says:

    Great work.
    There are a lot options to increase, but already a great gallery

  29. maria porto Says:

    Hi! I can’t make it shows pontuaction (symbols like ~ ç ´) on the description… All pontuactions works fine but the ones loaded from callback.json. Thanks.

  30. Reimar Says:

    Great slider - thanks!

  31. Alan Says:

    In the options, put onWarp: null.

    And put this lines in ShowWarp:

    if(this.options.onWarp != null){
    this.options.onWarp(item);
    }

    You can do something now when te new image loaded.
    Good Luck

  32. Gio Says:

    Hi there, first of all : GREAT WORK !
    I have one question, is there a way to have the complete image and header link to a url instead of only the title ?

    THX, GIO

  33. Pisit Says:

    Somehow, it works fine with my firefox
    but in IE7 occures error ” ‘null’ is null or not an object”

    Could you please tell me how to solve this problem?

  34. Ruben Says:

    Question: I don’t see in the “Setup” where you load the images?

  35. nord Says:

    My Next- and Previous buttons aren’t showing. The path is right, though. What could be the reason?

  36. nord Says:

    (In fact, no image mentionned in the ferdinand.slider.js-script is shown at all)

  37. nord Says:

    When it’s on top of my page, it works. When it’s at the bottom, the images from ferdinand.slider.js-script fail to show up. Odd…

  38. nord Says:

    Hmm, sometimes the images show up, sometimes they don’t. I believe your script is really unpredictable and therefore another scriptaculous failscript.

  39. Vladimir Cvetic Says:

    @nord

    And I believe that those who are born as spammers stay spammers till arrested.

    If it works here and on 100 other sites and you can’t get it to work, that leads me to believe that you are just another traveler (hmm maybe a driver) on a Fail O’ Copter.

  40. emirem Says:

    Pozdravi iz USA. Dobar ti je script! Svaka cast!

  41. fcif Says:

    How to make text fade in up ?
    Not slide down, but i want to make it slide up.

Leave a Reply