]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
docs: fix plugins instantiation examples in Javascript docs 11545/head
authorNicolas Coden <nicolas@ncoden.fr>
Thu, 18 Oct 2018 21:48:35 +0000 (23:48 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Thu, 18 Oct 2018 21:48:35 +0000 (23:48 +0200)
See discussion in https://github.com/zurb/foundation-sites/pull/11508

docs/pages/javascript.md

index 33d97a49c8c543328001a53bd3792cc419b9fb36..0d2bed81e36495c4daf0f2ff51cd505665c5af34 100644 (file)
@@ -44,23 +44,23 @@ By default, Foundation is exported as [UMD modules](http://bob.yexley.net/umd-ja
 For example with [ES6](https://github.com/lukehoban/es6features#readme) (the ESM format):
 ```js
 import Foundation from 'foundation-sites';
-const $dropdown = new Foundation.Dropdown('#mydropdown');
+const $dropdown = new Foundation.Dropdown($('#mydropdown'));
 // Or
 import { Dropdown } from 'foundation-sites';
-const $dropdown = new Dropdown('#mydropdown');
+const $dropdown = new Dropdown($('#mydropdown'));
 ```
 
 With [RequireJs](http://requirejs.org/) (the AMD format):
 ```js
 define(['foundation'], function(Foundation) {
-  var $dropdown = new Foundation.Dropdown('#mydropdown');
+  var $dropdown = new Foundation.Dropdown($('#mydropdown'));
 });
 ```
 
 With [Node.js](https://www.safaribooksonline.com/library/view/learning-javascript-design/9781449334840/ch11s03.html) (the CommonJs format):
 ```js
 var Foundation = require('foundation-sites');
-var $dropdown = new Dropdown('#mydropdown');
+var $dropdown = new Dropdown($('#mydropdown'));
 ```
 
 #### Available formats