]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
[docs] fixed programmatic use of interchange 9332/head
authorJörn Röder <joernroeder@users.noreply.github.com>
Sun, 6 Nov 2016 19:19:35 +0000 (20:19 +0100)
committerGitHub <noreply@github.com>
Sun, 6 Nov 2016 19:19:35 +0000 (20:19 +0100)
I was running into this issue and it took me a while to figure out that by providing a single string as `rules` option the [loop](https://github.com/zurb/foundation-sites/blob/develop/js/foundation.interchange.js#L109) iterates over each character in the option string. Providing an array fixed it.

docs/pages/interchange.md

index 842af5725b342b52491c5b961ba6e620f2c3c632..c1babc5027767dcb25ef88fcec00b207b77aec13 100644 (file)
@@ -85,5 +85,11 @@ When using Interchange programmatically, you need to pass in your ruleset in the
 
 ```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]"});
+var interchange = new Foundation.Interchange($photoFrame, {
+  rules: [
+    "[path/to/default.jpg, small]", 
+    "[path/to/medium.jpg, medium]",
+    "[path/to/large.jpg, large]"
+  ]
+ });
 ```