function ajax_command_css
7.x ajax.inc | ajax_command_css($selector, $argument) |
Creates a Drupal 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 Drupal.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
1 call to ajax_command_css()
- ajax_forms_test_advanced_commands_css_callback in drupal-7.x/
modules/ simpletest/ tests/ ajax_forms_test.module - Ajax callback for 'css'.
File
- drupal-7.x/
includes/ ajax.inc, line 1090 - Functions for use with Drupal's Ajax framework.
Code
function ajax_command_css($selector, $argument) {
return array(
'command' => 'css',
'selector' => $selector,
'argument' => $argument,
);
}