-
Notifications
You must be signed in to change notification settings - Fork 57
$.css()
Arthur Guiot edited this page Oct 1, 2017
·
3 revisions
This function was created to quickly apply a style to an element. So, you only need to give it an element, a style name property and the value of this property.
style=""
attribute of an element, which means that you can't modify the style that you defined in a .css
stylesheet.
As I said, this function requires 3 arguments. So, as an example, let's change the background color of an element when you hover it.
HTML:
<div class="testElement">Hello World 🌎!</div>
JS:
$.on($.select(".testElement"), "mouseover", function() {
$.css($.select(".testElement"), "background", "red")
})
You can also use with multiple styles:
$.css(".testElement", {
"background": "red",
"color": "blue"
});
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()