-
Notifications
You must be signed in to change notification settings - Fork 57
The 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 behaves.
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.
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.
// 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 + " " + lines[i] + "<br>")
}
Don't hesitate to ask your questions
- Home
- The Core Languages
- Getting Started: Installation
- The Basics (
$.var()
+$.target()
) - Developing for DisplayJS
-
$.select()
- Text related
- If...else
$.xss()
$.repeat()
$.custom()
$.live()
$.load()
$.on()
$.onEvent()
$.ready()
- Scroll API
$.all()
$.clone()
$.is()
$.valEmpty()
$.remove()
$.show()
&$.hide()
$.ajax()
- Class Related
$.css()
$.getStyle()
- Fade effects
$.extend()
$.dynamic()
$.parent()
- Elements-Nodes
$.component()
$.time_ago()
$.copy()
$.then()
$.sleep()
$.getProp()