CssCommand
class CssCommand implements CommandInterface (View source)
An AJAX command for calling the jQuery css() method.
The 'css' command will instruct the client to use the jQuery css() method to apply the CSS arguments to elements matched by the given selector.
This command is implemented by Drupal.AjaxCommands.prototype.css() defined in misc/ajax.js.
Properties
| protected string | $selector | A CSS selector string. |
|
| protected array | $css | An array of property/value pairs to set in the CSS for the selector. |
Methods
Constructs a CssCommand object.
Adds a property/value pair to the CSS to be added to this element.
Implements Drupal\Core\Ajax\CommandInterface:render().
Details
__construct(string $selector, array $css = [])
Constructs a CssCommand object.
$this
setProperty($property, $value)
Adds a property/value pair to the CSS to be added to this element.
render()
Implements Drupal\Core\Ajax\CommandInterface:render().