This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
css
larukedi edited this page Oct 17, 2014
·
16 revisions
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
Usage: $l.css.toggle(element, className)
var target = $l('#element');
$l.css.toggle(target, 'hide');
var target = $l('#element');
$l.css.setProperty(target, 'text-align', 'center');
console.log($l.css.getProperty(target, 'text-align')); // prints center
Usage: $l.css.transition(element, properties)
var target = $l('#element');
// first sample
$l.css.transition(target, { 'color': 'red' });
// second sample
$l.css.transition(
$l('body'),
{ 'background-color': [ 'silver', '5s ease' ], 'font-size': '25px' }
);
Please don't hesitate to submit issues and pull requests.