1 ajax.inc ajax_command_css($selector, $argument)

Creates a Backdrop Ajax 'css' command.

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 Backdrop.ajax.prototype.commands.css() defined in misc/ajax.js.

Parameters

$selector: A jQuery selector string. If the command is a response to a request from an #ajax form element then this value can be NULL.

$argument: An array of key/value pairs to set in the CSS for the selector.

Return value

An array suitable for use with the ajax_render() function.

See also

http://docs.jquery.com/CSS/css#properties

Related topics

File

core/includes/ajax.inc, line 1205
Functions for use with Backdrop's Ajax framework.

Code

function ajax_command_css($selector, $argument) {
  return array(
    'command' => 'css',
    'selector' => $selector,
    'argument' => $argument,
  );
}