CRecordWebSetStylesForElements
The
The message is part of the
The API is located in the plugin NY_
{ "id": "8a6a97e6-e628-49e4-a8ed-936b82779bff", "name": "WEB_SET_STYLES_FOR_ELEMENTS ", "description": "Set a style for all elements matching the selector.", "slots": [ { "key": "1", "name": "SELECTOR ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The selector for searching elements, like .myClasses or #myId." }, { "key": "2", "name": "STYLES ", "direction": "REQUEST", "mandatory": "true", "type": "STRING_PROPERTIES", "description": "The styles to set." } ] }
Arguments
-
SELECTOR : The selector to find HTML elements.
Example: ".example".
Find more examples here -
HTML : The styles to set for each matching HTML element.
Usage with the helper class CWebApi
The easiest way is to call the corresponding method in the CWebApi class. The use of the class is described there.
mWebApi.setStylesForElements(@NotNull final StringaSelector , @NotNull final CStringPropertiesaStyles );
Usage as message
The
public void setStylesForElements(@NotNull final CTargetAddressa , @NotNull final StringRemote Skin AddressaSelector , @NotNull final CStringPropertiesaStyles ) throws CException {// Envelope final CEnvelope env = CEnvelope.forSingleTarget(m );Remote Skin Address// Record final CRecord record =CRecordWebSetStylesForElements .create();CRecordWebSetStylesForElements .setSelector(record,aSelector );CRecordWebSetStylesForElements .setStyles(record,aStyles );// send message sendNotification(env, record); }