]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
updates interchange docs to demonstrate programmatic use
authorChris Oyler <chris@zurb.com>
Mon, 4 Jan 2016 22:50:33 +0000 (14:50 -0800)
committerChris Oyler <chris@zurb.com>
Mon, 4 Jan 2016 22:50:33 +0000 (14:50 -0800)
docs/pages/interchange.md

index e88c85d182332adab3d7bdb6ff504fbd5912b62f..842af5725b342b52491c5b961ba6e620f2c3c632 100644 (file)
@@ -76,3 +76,14 @@ To add your own named media queries, add them as properties to `Foundation.Inter
 ```js
 Foundation.Interchange.SPECIAL_QUERIES['square'] = 'screen and (aspect-ratio: 1/1)';
 ```
+
+---
+
+## Programmatic Use
+
+When using Interchange programmatically, you need to pass in your ruleset in the `options` object, as well as the *container* element, *not* the content elements, like so:
+
+```js
+var $photoFrame = $('#some-container');
+var interchange = new Foundation.Interchange($photoFrame, {rules: "[path/to/default.jpg, small], [path/to/medium.jpg, medium], [path/to/large.jpg, large]"});
+```