Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
larukedi edited this page Oct 13, 2014 · 16 revisions

Adding/removing/checking a class

var target = $l('#element');

$l.css.addClass(target, 'hide');
console.log($l.css.hasClass(target, 'hide')); // returns true

$l.css.removeClass(target, 'hide');
console.log($l.css.hasClass(target, 'hide')); // returns false

Toggle a class

Usage: $l.css.toggle(element, className)

var target = $l('#element');
$l.css.toggle(target, 'hide');

Setting/getting CSS attributes

var target = $l('#element');

$l.css.setProperty(target, 'text-align', 'center');
console.log($l.css.getProperty(target, 'text-align')); // prints center
Clone this wiki locally