Home > widget-integration > StickyService > setStyle
StickyService.setStyle() method
Writes an inline style only when the value actually changes.
Sticky sync reruns on scroll, resize, and DOM mutations. Unconditional writes emit a style attribute mutation on every pass, which re-triggers the sticky MutationObservers and keeps the sync loop running with no user input. Override when a shop needs different write semantics.
Signature:
protected setStyle(element: HTMLElement | null | undefined, property: string, value: string): boolean;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
element |
HTMLElement | null | undefined | |
|
property |
string | |
|
value |
string |
Returns:
boolean
True when the inline style changed.