Skip to content

Spoiler

Ivan Kaduk edited this page May 2, 2016 · 5 revisions

Classes

Spoiler

this class will create spoiler.

Members

velocity
spoilerStatus
clickable

Functions

getStatus(index)String | Array

returning status of spoiler (opened, closed)

toggle(index)

toggle spoiler element

Spoiler

this class will create spoiler.

Kind: global class
Version: 2.0.1
Author: Ivan Kaduk
Copyright: Ivan Kaduk 2016.

new Spoiler(className, status, velocity, title, content)

Param Type Description
className String class of div wich containe spoiler child elements.
status String start status of spoiler, it can be 'opened' or 'closed'.
velocity int velocite of slide in px per second
title String class of spoiler button
content String class of spoiler content div

Example

var spoiler = new Spoiler('spoiler','opened', 1);

Spoiler~spoilerName

Kind: inner property of Spoiler
Privat:

Spoiler~spoilerTitle

Kind: inner property of Spoiler
Default: title
Privat:

Spoiler~spoilerContentName

Kind: inner property of Spoiler
Default: content
Privat:

Spoiler~spoiler

Kind: inner property of Spoiler
Privat:

Spoiler~title

Kind: inner property of Spoiler
Privat:

Spoiler~secondtitle

Kind: inner property of Spoiler
Privat:

Spoiler~content

Kind: inner property of Spoiler
Privat:

Spoiler~contentHeight

Kind: inner property of Spoiler
Privat:

Spoiler~titleText

Kind: inner property of Spoiler
Privat:

velocity

Kind: global variable
Default: 10
Access: public

spoilerStatus

Kind: global variable
Access: public

clickable

Kind: global variable
Access: public

getStatus(index) ⇒ String | Array

returning status of spoiler (opened, closed)

Kind: global function
Returns: String - - status of current spoilerArray - - statuses of all spoilers with current className
Access: public

Param Type Description
index int it is index of spoiler element with current className

Example

spoiler.getStatus(0);

toggle(index)

toggle spoiler element

Kind: global function
Access: public

Param Type Description
index int it is index of spoiler element with current className

Example

spoiler.toggle();