Observe changes to the modal lightbox and call custom callbacks as nodes are added to the DOM.
- 0.1.1
-
7.1
-
7.0
- Not Applicable
- Squarespace plan that supports JavaScript.
-
Options
-
Page Specific
-
This option will be the one most will want to use if you have only a single page you want to have this effect.
-
Add code from file modal lightbox observe changes.html to Page Settings > Advanced > Page Header Code Injection for the page. Please see Per-page code injection. Read the code for any instructions within.
-
-
Site-wide
-
This option is the one you want to use if you have multiple elements such as a store page and product blocks where you want to have this effect.
-
Add code from file product quick view observe changes.html to Website > Pages > Website Tools > Code Injection > FOOTER. Please see Add code to code injection. Read the code for any instructions within.
-
-
-
Add your callback names to the code.
Your callbacks must accept a node as a parameter.
Following is a very generalized example of a callback. The callback(s) must be defined before the code of this effect. Note the use of var.
<script>
var mlocNodeAddedLog = ( node ) => {
console.log ( 'mlocNodeAddedLog : ', node );
};
</script>
This code is a base for other effects.
Please consider making a donation.
-
2024-05-23
- minor tweaks, no functional changes
- bumped version to 0.1.1
-
2024-05-01
- initial version