From: Jörn Röder Date: Sun, 6 Nov 2016 19:19:35 +0000 (+0100) Subject: [docs] fixed programmatic use of interchange X-Git-Tag: v6.3-rc1~1^2~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9332%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git [docs] fixed programmatic use of interchange 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. --- diff --git a/docs/pages/interchange.md b/docs/pages/interchange.md index 842af5725..c1babc502 100644 --- a/docs/pages/interchange.md +++ b/docs/pages/interchange.md @@ -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]" + ] + }); ```