Skip to content Skip to sidebar Skip to footer

Creating First Jquery Slideshow Plugin, Converting From Javascript

I was asking about a jQuery plugin with image, title and description jQuery slide show. But can't find such. So tried to build a very small and easy [ugly] slide-show using only ja

Solution 1:

You can use nivo slider .

You just have to mention description of an image in alt attribute and title of an image in title attribute.

And just attach the plugin to your wrapper element:

$(window).load(function() {
    $('#main').nivoSlider(); 
}); 

Edit1: A simple way to create such plugin

jQuery.fn.imgSlider = function( options ) {

    // default settings:var defaults = {
        textColor: "#000",
        backgroundColor: "#fff",
        fontSize: "16px",
        getTextFromTitle: true,
        getTextFromAlt: false,
        animateOpacity: true,
        animationDuration: 500,
        clickImgToGoToNext: true,
        clickImgToGoToLast: false,
        nextButtonText: "next",
        previousButtonText: "previous",
        nextButtonTextColor: "red",
        previousButtonTextColor: "red"
    };

    var settings = $.extend( {}, defaults, options );

    returnthis.each(function() {
        // Plugin code would go here...
    });

};

call the plugin

$( "div" ). imgSlider();

Edit 2

I have created a jQuery Image Slider Plugin. here is the examplewith annotated code.

Post a Comment for "Creating First Jquery Slideshow Plugin, Converting From Javascript"