Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "swup", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Css animating between website pages.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -17,3 +17,3 @@ # swup | ||
`is-animating` is the main class you should worry about, as it enables the animations. `is-leaving` and `is-rendering` can be used for defining different animations for animating the elements in/out. `is-changing` may be used for for displaying some kind of loading while the transition is being done. | ||
`is-animating` is the main class you should worry about, as it enables the animations. `is-leaving` and `is-rendering` can be used for defining different animations for animating the elements in/out. `is-changing` may be used for displaying some kind of loading while the transition is being done. | ||
@@ -155,3 +155,5 @@ ### Example | ||
### Preload | ||
Preload is an additional feature that can be used in combination with cache. When enabled, swup starts loading the page on hover of the link and does not wait for the user to click on the link. In case the page is not loaded at the time of clicking on the link, swup simply waits for the request to finish and does not create new request. If cache is disabled, swup still preloads pages of hovered links, but the contents of cache are removed after each page transition. | ||
Preload is an additional feature that can be used in combination with cache. When enabled, swup starts loading the page on hover of the link and does not wait for the user to click on the link. In case the page is not loaded at the time of clicking on the link, swup simply waits for the request to finish and does not create new request. Also, swup only creates one request at the time, so don't worry, your server won't be overwhelmed by few people just passing their cursor through some grid of links. | ||
If cache is disabled, swup still preloads pages of hovered links, but the contents of cache are removed after each page transition. | ||
In case you want to preload some page automatically without any trigger by user, `data-swup-preload` on the link will do the trick. | ||
```javascript | ||
@@ -202,3 +204,3 @@ preload: true | ||
document.addEventListener('swup:contentReplaced', event => { | ||
swup.elements.forEach((element) => { | ||
swup.options.elements.forEach((element) => { | ||
loadComponents(document.querySelector(element)) | ||
@@ -226,7 +228,7 @@ }) | ||
```javascript | ||
swup.elements.forEach((element) => { | ||
swup.options.elements.forEach((element) => { | ||
// do whatever for each replaced element | ||
}) | ||
``` | ||
or possibly use built in function for your own functions | ||
or possibly use built in function for your own purpose | ||
```javascript | ||
@@ -233,0 +235,0 @@ // navigates to /someRoute with the animations and all |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
108882
245
0