# ...params(method, params)
Apply a method on each elements and returns the collection to chain methods
Parameters
Name | Types | Description |
---|---|---|
method | Function |
Accept a method to run on each elements |
params | any |
A list of argument to call the method with |
Returns
GaspardCollection
GaspardCollection containing elements
# after(htmlString)
Insert content after each elements
Parameters
Name | Types | Description |
---|---|---|
htmlString | string |
Returns
GaspardCollection
GaspardCollection containing elements
# append(element)
Append element to each elements
Parameters
Name | Types | Description |
---|---|---|
element | Element |
Returns
GaspardCollection
GaspardCollection containing elements
# attr(attribute, value)
Set attribute to each elements
Parameters
Name | Types | Description |
---|---|---|
attribute | string |
|
value | any |
Returns
GaspardCollection
GaspardCollection containing elements
# before(htmlString)
Insert content before each elements
Parameters
Name | Types | Description |
---|---|---|
htmlString | string |
Returns
GaspardCollection
GaspardCollection containing elements
# css(ruleName, value)
Set CSS value to each elements
Parameters
Name | Types | Description |
---|---|---|
ruleName | string |
|
value | string |
Returns
GaspardCollection
GaspardCollection containing elements
# fadeIn(duration)
Fade in each elements
Parameters
Name | Types | Description |
---|---|---|
duration | number |
Returns
GaspardCollection
GaspardCollection containing elements
# fadeOut(duration)
Fade out each elements
Parameters
Name | Types | Description |
---|---|---|
duration | number |
Returns
GaspardCollection
GaspardCollection containing elements
# find(selectorOrElement)
Returns a collection of matched elements either found in the DOM based on passed argument
Parameters
Name | Types | Description |
---|---|---|
selectorOrElement | (string |
Element) |
Returns
GaspardCollection
GaspardCollection containing elements
# GaspardCollection(elements)
Use GaspardCollection class to perform actions on Elements
Parameters
Name | Types | Description |
---|---|---|
elements | (Element[] |
Element |
Returns
GaspardCollection
GaspardCollection containing elements
# html(htmlString)
Set html to each elements
Parameters
Name | Types | Description |
---|---|---|
htmlString | string |
Returns
GaspardCollection
GaspardCollection containing elements
# off(eventName, eventHandler)
Remove an event handler function for each elements
Parameters
Name | Types | Description |
---|---|---|
eventName | string |
|
eventHandler | Function |
Returns
GaspardCollection
GaspardCollection containing elements
# on(eventName, eventHandler)
Attach an event handler function for each elements
Parameters
Name | Types | Description |
---|---|---|
eventName | string |
|
eventHandler | Function |
Returns
GaspardCollection
GaspardCollection containing elements
# prepend(element)
Prepend element to each elements
Parameters
Name | Types | Description |
---|---|---|
element | Element |
Returns
GaspardCollection
GaspardCollection containing elements
# replaceWith(htmlString)
Replace each elements
Parameters
Name | Types | Description |
---|---|---|
htmlString | string |
Returns
GaspardCollection
GaspardCollection containing elements
# s(classNames)
Add classes to each elements
Parameters
Name | Types | Description |
---|---|---|
classNames | string |
Returns
GaspardCollection
GaspardCollection containing elements
# s(classNames, state)
Toggle classes to each elements
Parameters
Name | Types | Description |
---|---|---|
classNames | string |
|
state | boolean |
Returns
GaspardCollection
GaspardCollection containing elements
# s(classNames)
Remove classes to each elements
Parameters
Name | Types | Description |
---|---|---|
classNames | string |
Returns
GaspardCollection
GaspardCollection containing elements
# text(textString)
Set text to each elements
Parameters
Name | Types | Description |
---|---|---|
textString | string |
Returns
GaspardCollection
GaspardCollection containing elements
# trigger(eventName, data)
Execute all handlers to each elements
Parameters
Name | Types | Description |
---|---|---|
eventName | string |
|
data | Object |
Returns
GaspardCollection
GaspardCollection containing elements