Skip to content

Developing for DisplayJS

Arthur Guiot edited this page Jul 29, 2017 · 2 revisions

Like DisplayJS?

If you like DisplayJS, there are three things that you can do:

  • Using DisplayJS in projects and sharing DisplayJS to your friends
  • Star ⭐️ DisplayJS on Github and help developing DisplayJS
  • Create plugins for DisplayJS

How to develop plugins for DisplayJS

** ⚠️ You'll need at least the version v0.3.2-beta of DisplayJS if you want to develop plugins.**

When you want to develop plugins, your work will only consist of creating functions for DisplayJS. Let's see how you add function to our library using the $.fn() function:

JS:

// You can change the "myFunctionName" by your custom name
$.fn.myFunctionName = function (args) {
   // If you don't want to use JSON for your arguments, you can but we recommend using it.
   var arg = $.extend({ text: "Hello World 🌎!" }, args);
   alert(arg.text)
})

Now, you can simply use the $.myFunctionName() function normally.


⚠️ Questions?

Don't hesitate to ask your questions ⁉️ in the issue part 😁

Clone this wiki locally