up.Preview.prototype.addClass([element], className)
Instance method
Temporarily adds a CSS class to an element.
The class will be removed once the preview ends.
Example
This preview sets a temporary .loading class on the targeted fragment:
up.preview('loading-class', function(preview) {
preview.addClass('loading')
})
Parameters
[element=this.fragment]
optional
The element or selector to change.
If omitted, the targeted fragment will be changed.
Type: Element | string
className
required
The CSS class to add.
Type: string