[layer]...[/layer]
A layer is timed content that can appear and disappear with an animation.
With the layer shortcode you can display any type of content and you can specify where, when and how it should appear and disappear.
You can use it:
Start - On - End Attributes | |
---|---|
start |
Property and value pairs (prop: value) that are applied to the layer before showing it, separated by commas. Use the 'on' attribute to specify the end state of the show animation, and the 'end' attribute to specify the state of the layer after hiding it. If the 'end' attribute is not specified, then it is identical with the 'start' attribute. The supported properties are:
|
start_left start_top start_right start_bottom |
These attributes can only be used when the layer is in an overlay.
They allow you to specify the start state of the layer depending on the direction the mouse pointer has been moved into the area of the overlay. They have the same format as the start attribute. For example, when the mouse pointer enters the area of the overlay from left, first, the properties specified by the start attribute are applied to the layer, then the properties specified by the start_left attribute. Similarly to these attributes, the end_left, end_top, end_right and end_bottom attributes allow you to specify the end state of the layer depending on the direction the mouse pointer has been moved out of the area of the overlay. If an 'end' attribute ('end_left', ... ,'end_bottom') attribute is not specified, then it is identical with the corresponding 'start' ('start_left', ... , 'start_bottom') attribute.The 'Gallery - follow mouse' overlay uses these attributes. For details, please see the Built-in Overlays section. |
startduration | How long, in milliseconds, the show animation should take. Default: 400 |
startduration_left startduration_top startduration_right startduration_bottom |
These attributes can only be used when the layer is in an overlay.
They allow you to specify the duration of the show animation depending on the direction the mouse pointer has been moved into the area of the overlay. |
starteasing |
Specifies the easing function for the show animation.
Easing functions (timing functions) specify how the intermediate values are calculated during the start animation. It allows for a transition to change speed over its duration.
Supported functions:
|
starteasing_left starteasing_top starteasing_right starteasing_bottom |
These attributes can only be used when the layer is in an overlay.
They allow you to specify the easing function for the show animation depending on the direction the mouse pointer has been moved into the area of the overlay. |
startevent |
Specifies the event the starttime attribute is relative to.
Possible values:
|
starttime | The amount of time after the show animation of the layer should start, in milliseconds. Default: 600 |
starttime_left starttime_top starttime_right starttime_bottom |
These attributes can only be used when the layer is in an overlay.
They allow you to specify the amount of time after the show animation of the layer should start depending on the direction the mouse pointer has been moved into the area of the overlay. |
on | Property and value pairs that are applied to the layer when it is visible. See the 'start' attribute for details. |
duration | The duration until the layer is visible, in milliseconds. If set to 0, the hide animation won't start automatically. Default: 0 |
end | Property and value pairs that are applied to the layer after hiding it. See the 'start' attribute for details. |
end_left end_top end_right end_bottom |
These attributes can only be used when the layer is in an overlay.
They allow you to specify the end state of the layer depending on the direction the mouse pointer has been moved out of the area of the overlay. See the start_left, start_top, start_right, start_bottom attributes for details. |
endduration | How long, in milliseconds, the hide animation should take. Default: 20 |
endduration_left endduration_top endduration_right endduration_bottom |
These attributes can only be used when the layer is in an overlay.
They allow you to specify the duration of the hide animation depending on the direction the mouse pointer has been moved out of the area of the overlay. |
endeasing | Specifies the easing function for the hide animation. Possible values are the same as for the starteasing attribute. |
endeasing_left endeasing_top endeasing_right endeasing_bottom |
These attributes can only be used when the layer is in an overlay.
They allow you to specify the easing function for the hide animation depending on the direction the mouse pointer has been moved out of the area of the overlay. |
Other Attributes | |
---|---|
allow_empty | Specifies whether the layer should be displayed even if it has no content (true | false). Default is false. |
required |
This attribute only works in overlays.
Specifies whether the layer is required or not. Empty layers are not displayed only if their allow_empty attribute is set to true. If an overlay has required layers, then at least one of the required layers must be displayed otherwise the overlay won't be shown. |
endasstarted |
This attribute has effect only in overlays and when the mouse dependent start attributes (start_left, etc.) are specified but the end attributes (end_left, etc.) are not.
In this case, the endasstarted attribute specifies whether the hide animation of the layer should end in the same state as the show animation started or the start_left, ..., start_bottom attributes determine the end state.
In other words, if the endasstarted attribute is set to true and the mouse pointer enters the overlay from the left, than regardless of the direction the mouse pointer moves out the overlay, the start_left attribute determines the end state of the hide animation (the hide animation will end in the same state as the show animation started).
But if endasstarted is false, the end state of the hide animation depends on the direction the mouse pointer moves out the overlay. If the direction is up, the start_top attribute determines the end state, etc.
Possible values: true | false. Default is false. |
breakanim |
By default, if the show animation of a layer runs when the layer should start to hide, the show animation turns back instead of beginning the hide animation, but this behavior can be changed with this attribute.
If the breakanim attribute is set to true, the show animation stops and the hide animation starts.
This attribute is useful if the start and end states are different or when the mouse dependent start attributes (start_left, etc.) are specified.
Possible values: true | false. Default is false. |
showonce | Specifies whether the layer should appear only once, or not (true | false). Default: false |
Examples:
Since layers are absolutely positioned elements, it is always advisable to set their positions. This is why the examples below always specify the layer positions (usually the left and top).
[layer start="opacity:0" on="opacity:1" style="left:0, top:0"]Layer content[/layer]
[layer start="opacity:0" on="opacity:1" starttime="0" startduration="2000" style="left:0, top:0"]Layer content[/layer]
[layer start="left:0, top:0" on="left: 100, top: 50"]Layer content[/layer]
[layer start="opacity:0, left:'0%'" on="opacity:1, left: '50%'" end="opacity:0, left:'100%'" style="top:'0px'"]Layer content[/layer]
[layer start="top:'100%'" on="top:'0%'" style="left:0px"]Layer content[/layer]
[layer start="left:'50%',top:'100%', marginLeft:'-50%W', marginTop:'-50%H'" on="left:'50%',top:'50%', marginLeft:'-50%W', marginTop:'-50%H'" ]layer content[/layer]
[layer start="clip:{right:0}" on="clip:{right:'auto'}" style="left:0, top:0"]Layer content[/layer]
[layer start="clip:{left:'100%W'}" on="clip:{left:'auto'}" style="left:0, top:0"]Layer content[/layer]
[layer start="clip:{left:-1}" on="clip:{left:'auto'}" style="left:0, top:0"]Layer content[/layer]
[layer start="clip:{right:0, bottom:0}" on="clip:{right:'auto', bottom:'auto'}" style="left:0, top:0"]Layer content[/layer]
[layer start="trafo:{moveX:0}" on="trafo:{moveX:100}" style="left:0, top:0"]content[/layer]
[layer start="trafo:{moveX:0, moveY:0}" on="trafo:{moveX:100, moveY:100}" style="left:0, top:0"]content[/layer]
[layer start="trafo:{rotate:3.14}" on="trafo:{rotate:0}" style="left:0, top:0"]content[/layer]
[layer start="trafo:{rotate:3.14, originX:'0%', originY:'0%'}" on="trafo:{rotate:0}" style="left:0, top:0"]content[/layer]
[layer start="trafo:{scaleX:0}" on="trafo:{scaleX:1}" style="left:0, top:0"]content[/layer]
[layer start="trafo:{scaleX:0, originX:'100%', originY:'100%'}" on="trafo:{scaleX:1}" style="left:0, top:0"]content[/layer]
[layer start="trafo:{scaleX:0, scaleY:0}" on="trafo:{scaleX:1, scaleY:1}" style="left:0, top:0"]content[/layer]
[layer start="trafo:{moveX:0, moveY:0, scaleX:0, scaleY:0, rotate:3.14, originX:'0%', originY:'0%'}" on="trafo:{moveX:100, moveY:100, scaleX:1, scaleY:1, rotate:0}" style="left:0, top:0"]content[/layer]
Live Examples: Overlays, Slideshows