Element parameters

You can use/change the following options in the slider setup method. For example:

<script>
    jQuery(document).ready(function($) {
        $("#slider-wrapper").transitionSlider({
            slides: [
                {
                    src: "../assets/images/1.jpg",
                    layerWidth: 1500,
                    layerHeight: 950,
                    elements: [
                        {
                            type: "text",
                            content: "Content for text element.",
                            textColor: "#ffffff",
                            fontSize: "70px",
                            fontFamily: "Pacifico",
                            padding: "10px 100px 10px 100px",
                            backgroundColor: "rgba(0,0,0,0)",
                            position: {
                                x: "center",
                                y: "center",
                                offsetX: 0,
                                offsetY: 30
                            },
                            startAnimation: {
                                animation: "fadeInDown",
                                speed: 1000
                            },
                            endAnimation: {
                                animation: "fadeOutUp",
                                speed: 500,
                                delay: 500
                            },
                            hover: {
                                backgroundColor: "rgba(100,100,100,1)",
                                borderColor: "rgba(20,20,20,0)",
                                textColor: "#cccccc",
                                padding: "30px 30px 30px 30px"
                            }
                        }
                }
            ]
        );
    });
</script>

There are 6 types of layer elements:

  • Text

  • Heading

  • Image

  • Button

  • Video

  • iFrame

Below is a set of parameters for each type of element.

Text

Parameter

Type

Default

Description

type

string

"text"

Defines type of the element. (Value for text element is "text".)

htmlTag

string

"p"

Defines html tag of text element. (Default element tag paragraph).

content

string

Content of text element.

textColor

string

Font color of the text element. (Example: "#ffffff").

fontSize

number/string

fontFamily

string

padding

string

paddingTop

string

paddingRight

string

paddingBottom

string

paddingLeft

string

backgroundColor

string

fontWeight

string

lineHeight

string

textAlign

string

borderWidth

number/string

borderStyle

string

borderColor

string

borderRadius

number/string

width

number/string

Property defines the width of the element. If parameter is number then default unit is in px. If value is string then value must contain units as well. Example: "150px".

height

number/string

Property defines the height of the element. If parameter is number then default unit is in px. If value is string then value must contain units as well. Example: "150px".

customCSS

string

If you miss any CSS property add it here. Example: "margin-top: 15px; opacity: 0.5;".

cssClass

string

Add your custom CSS class WITHOUT the dot, e.g: my-class. Add multiple classes separated with space, e.g: my-class my-class-2. Classes for slide navigation: slide-next, slide-prev. Classes for go to slide: slide-1, slide-2, ...

hover

object

false

{

width

string

height

string

backgroundColor

string

padding

string

border

string

borderRadius

string

}

position

object

Object with position parameters of text element.

{

x

string

X or horizontal position of element. Three available values: "left", "center", "right".

y

string

Y or vertical position of element. Three available values: "top", "center", "bottom".

offsetX

number

This value can be a positive or negative number and defines how much offset is added to the text element from the current X position in px.

offsetY

number

This value can be a positive or negative number and defines how much offset is added to the text element from the current Y position in px.

}

startAnimation

object

Object with start animation parameters of text element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

endAnimation

object

Object with end animation parameters of text element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

Heading

Parameter

Type

Default

Description

type

string

"text"

Defines type of the element. (Value for heading element is "text".)

htmlTag

string

"h2"

Defines html tag of heading element. (Default element tag heading 2).

content

string

Content of heading element.

textColor

string

Font color of the heading element. (Example: "#ffffff").

fontSize

number/string

fontFamily

string

padding

string

paddingTop

string

paddingRight

string

paddingBottom

string

paddingLeft

string

backgroundColor

string

fontWeight

string

lineHeight

string

textAlign

string

borderWidth

number/string

borderStyle

string

borderColor

string

borderRadius

number/string

width

number/string

Property defines the width of the element. If parameter is number then default unit is in px. If value is string then value must contain units as well. Example: "150px".

height

number/string

Property defines the height of the element. If parameter is number then default unit is in px. If value is string then value must contain units as well. Example: "150px".

customCSS

string

If you miss any CSS property add it here. Example: "margin-top: 15px; opacity: 0.5;".

cssClass

string

Add your custom CSS class WITHOUT the dot, e.g: my-class. Add multiple classes separated with space, e.g: my-class my-class-2. Classes for slide navigation: slide-next, slide-prev. Classes for go to slide: slide-1, slide-2, ...

hover

object

false

{

width

string

height

string

backgroundColor

string

padding

string

border

string

borderRadius

string

}

position

object

Object with position parameters of heading element.

{

x

string

X or horizontal position of element. Three available values: "left", "center", "right".

y

string

Y or vertical position of element. Three available values: "top", "center", "bottom".

offsetX

number

This value can be a positive or negative number and defines how much offset is added to the heading element from the current X position in px

offsetY

number

This value can be a positive or negative number and defines how much offset is added to the heading element from the current Y position in px

}

startAnimation

object

Object with start animation parameters of heading element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

endAnimation

object

Object with end animation parameters of heading element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

Button

Parameter

Type

Default

Description

type

string

"button"

Defines type of the element. (Value for button element is "button".)

content

string

Content of button element.

url

string

URL of the button element. (Example: "https://example.com").

urlTarget

string

Open button link in new tab (value: "blank") or in same tab (value: "self")

textColor

string

Font color of the button element. (Example: "#ffffff").

fontSize

number/string

fontFamily

string

padding

string

paddingTop

string

paddingRight

string

paddingBottom

string

paddingLeft

string

backgroundColor

string

fontWeight

string

lineHeight

string

textAlign

string

borderWidth

number/string

borderStyle

string

borderColor

string

borderRadius

number/string

width

number/string

Property defines the width of the element. If parameter is number then default unit is in px. If value is string then value must contain units as well. Example: "150px".

height

number/string

Property defines the height of the element. If parameter is number then default unit is in px. If value is string then value must contain units as well. Example: "150px".

customCSS

string

If you miss any CSS property add it here. Example: "margin-top: 15px; opacity: 0.5;".

cssClass

string

Add your custom CSS class WITHOUT the dot, e.g: my-class. Add multiple classes separated with space, e.g: my-class my-class-2. Classes for slide navigation: slide-next, slide-prev. Classes for go to slide: slide-1, slide-2, ...

hover

object

false

{

width

string

height

string

backgroundColor

string

padding

string

border

string

borderRadius

string

}

position

object

Object with position parameters of button element.

{

x

string

X or horizontal position of element. Three available values: "left", "center", "right".

y

string

Y or vertical position of element. Three available values: "top", "center", "bottom".

offsetX

number

This value can be a positive or negative number and defines how much offset is added to the button element from the current X position in px.

offsetY

number

This value can be a positive or negative number and defines how much offset is added to the button element from the current Y position in px.

}

startAnimation

object

Object with start animation parameters of button element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

endAnimation

object

Object with end animation parameters of button element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

Image

Parameter

Type

Default

Description

type

string

"image"

Defines type of the element. (Value for image element is "image".)

src

string

Path to the image src. (Example: "https://example.com/image.jpg").

padding

string

paddingTop

string

paddingRight

string

paddingBottom

string

paddingLeft

string

backgroundColor

string

borderWidth

number/string

borderStyle

string

borderColor

string

borderRadius

number/string

size

number

Property defines the width of the element. Parameter is number unit is in px. Example: 150. Height of image is scaled with aspect ratio of the image.

customCSS

string

If you miss any CSS property add it here. Example: "margin-top: 15px; opacity: 0.5;".

cssClass

string

Add your custom CSS class WITHOUT the dot, e.g: my-class. Add multiple classes separated with space, e.g: my-class my-class-2. Classes for slide navigation: slide-next, slide-prev. Classes for go to slide: slide-1, slide-2, ...

hover

object

false

{

backgroundColor

string

padding

string

border

string

borderRadius

string

}

position

object

Object with position parameters of image element.

{

x

string

X or horizontal position of element. Three available values: "left", "center", "right".

y

string

Y or vertical position of element. Three available values: "top", "center", "bottom".

offsetX

number

This value can be a positive or negative number and defines how much offset is added to the image element from the current X position in px.

offsetY

number

This value can be a positive or negative number and defines how much offset is added to the image element from the current Y position in px.

}

startAnimation

object

Object with start animation parameters of image element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

endAnimation

object

Object with end animation parameters of image element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

Video

Parameter

Type

Default

Description

type

string

"video"

Defines type of the element. (Value for video element is "video".)

src

string

Path to the video src. (Example: "https://example.com/video.mp4").

padding

string

paddingTop

string

paddingRight

string

paddingBottom

string

paddingLeft

string

backgroundColor

string

borderWidth

number/string

borderStyle

string

borderColor

string

borderRadius

number/string

size

number

Property defines the width of the element. Parameter is number unit is in px. Example: 150. Height of video is scaled with aspect ratio of the video.

customCSS

string

If you miss any CSS property add it here. Example: "margin-top: 15px; opacity: 0.5;".

cssClass

string

Add your custom CSS class WITHOUT the dot, e.g: my-class. Add multiple classes separated with space, e.g: my-class my-class-2. Classes for slide navigation: slide-next, slide-prev. Classes for go to slide: slide-1, slide-2, ...

hover

object

false

{

backgroundColor

string

padding

string

border

string

borderRadius

string

}

position

object

Object with position parameters of video element.

{

x

string

X or horizontal position of element. Three available values: "left", "center", "right".

y

string

Y or vertical position of element. Three available values: "top", "center", "bottom".

offsetX

number

This value can be a positive or negative number and defines how much offset is added to the video element from the current X position in px.

offsetY

number

This value can be a positive or negative number and defines how much offset is added to the video element from the current Y position in px.

}

startAnimation

object

Object with start animation parameters of video element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

endAnimation

object

Object with end animation parameters of video element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

iFrame

Parameter

Type

Default

Description

type

string

"iframe"

Defines type of the element. (Value for iFrame element is "iframe".)

src

string

Path to the iFrame src. (Example: "https://example.com").

padding

string

paddingTop

string

paddingRight

string

paddingBottom

string

paddingLeft

string

backgroundColor

string

borderWidth

number/string

borderStyle

string

borderColor

string

borderRadius

number/string

size

number

Property defines the width of the element. Parameter is number unit is in px. Example: 150. Height of iFrame is scaled with aspect ratio of the video.

customCSS

string

If you miss any CSS property add it here. Example: "margin-top: 15px; opacity: 0.5;".

cssClass

string

Add your custom CSS class WITHOUT the dot, e.g: my-class. Add multiple classes separated with space, e.g: my-class my-class-2. Classes for slide navigation: slide-next, slide-prev. Classes for go to slide: slide-1, slide-2, ...

hover

object

false

{

backgroundColor

string

padding

string

border

string

borderRadius

string

}

position

object

Object with position parameters of iFrame element.

{

x

string

X or horizontal position of element. Three available values: "left", "center", "right".

y

string

Y or vertical position of element. Three available values: "top", "center", "bottom".

offsetX

number

This value can be a positive or negative number and defines how much offset is added to the video element from the current X position in px

offsetY

number

This value can be a positive or negative number and defines how much offset is added to the video element from the current Y position in px

}

startAnimation

object

Object with start animation parameters of iFrame element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

endAnimation

object

Object with end animation parameters of iFrame element.

{

animation

string

speed

number

Duration of selected animation. Speed is defined as number in ms.

delay

number

Delay in ms of animation start.

}

Last updated