From 2c6adffb8afb197ff7d56095198cb8101672f867 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20R=C3=B6der?= Date: Sun, 6 Nov 2016 20:19:35 +0100 Subject: [PATCH] [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. --- docs/pages/interchange.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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]" + ] + }); ``` -- 2.47.2