Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.74 KB

README.md

File metadata and controls

37 lines (24 loc) · 1.74 KB
permalink title
pat/contentloader/
Content loader

Content loader pattern.

Load remote or local content into a target.


Deprecated

Please use pat-inject from Patternslib instead.


Configuration

Option Type Default Description
content string null CSS selector for content, which is going to replace the target. Can be a local element already in the DOM tree or come from an AJAX call by using the url option.
target string null CSS selector of target element, which is being replaced. If it's empty, the pattern element will be replaced.
trigger string "click" Event to trigger content loading.
url string null To load content from remote resource. Use 'el' to use with anchor tag href.

Examples

Example 1

Load content

Original Content
Replaced Content

Example 2

Load content