DisplayJS' core language

DisplayJS is a JavaScript framework that you can use for almost any of your web projects. And to make it easier to learn, we'll see how most of the functions believe.

Most of them are made to interact with elements in the DOM, and they are designed like that:

// create DisplayJS instance
var $ = new DisplayJS(window)

// the function
$.myFunction($.select(".myClass"), arguments...)

The important thing in these functions is the $.select() part. This part will select the first element by using CSS style queries (and if you want to use it for all elements, don't worry, we'll see that further in the docs 😊).

The other super important thing will notice in the example is that there is the $ at the beginning of every function, which is the DisplayJS main variable that we declared on line 2.

More generally

DisplayJS is pretty logic in his structure, everything starts with his declared variables and with a dot. After, comes the function, which will always take the subject of the operations as the first argument.

More examples

// create DisplayJS instance
var $ = new DisplayJS(window)

var lines = [
    "First line",
    "Second line",
    "Third line"
]
var text = $.select(".text")

for (let i in lines) {
    $.append(text, i + " " + i + "<br>")
}

⚠️ Questions?

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

results matching ""

    No results matching ""