ui.Slider.style

מחזירה את הסגנון של הווידג'ט ActiveDictionary, שאפשר לשנות אותו כדי לעדכן את הסגנונות של הווידג'ט.

מאפיינים שמתנהגים כמו המקבילים שלהם ב-CSS:

  ‫- height,‏ maxHeight,‏ minHeight (למשל, ‎'100px')

  ‫- width,‏ maxWidth,‏ minWidth (למשל, '100px')

  – מרווחים פנימיים, שוליים (לדוגמה, '4px 4px 4px 4px' או פשוט '4px')

  ‫- color, backgroundColor (לדוגמה, 'red' או '#FF0000')

  ‫- border (למשל: '1px solid black')

  ‫- borderColor (לדוגמה 'red black blue #FF0000')

  ‫- borderRadius (למשל '10px')

  ‫- borderStyle (למשל: solid dashed none dotted)

  ‫- borderWidth (למשל: ‎'1px 0px 1px 0px')

  - fontSize (לדוגמה, '24px')

  ‫- fontStyle (לדוגמה, 'italic')

  ‫- fontWeight (למשל: bold או 100)

  – fontFamily (לדוגמה, 'monospace' או 'serif')

  ‫- textAlign (למשל: 'left' או 'center')

  ‫- textDecoration (למשל: 'underline' או 'line-through')

  – whiteSpace (לדוגמה, nowrap או pre)

  – מוצג (true או false)

מאפיינים נתמכים של פריסה בהתאמה אישית (ראו את מסמכי התיעוד של ui.Panel.Layout):

  ‫- stretch ('horizontal', 'vertical', 'both')

  ‫- position ('top-right', 'top-center', 'top-left', 'bottom-right', ...)

שימושהחזרות
Slider.style()ui.data.ActiveDictionary
ארגומנטסוגפרטים
זה: ui.widgetui.Widgetמופע ui.Widget.

דוגמאות

עורך הקוד (JavaScript)

// Define a UI widget and add it to the map.
var widget = ui.Slider({style: {width: '400px'}});
Map.add(widget);

// View the UI widget's style properties; an ActiveDictionary.
print(widget.style());

// ActiveDictionaries are mutable; set a style property.
widget.style().set('backgroundColor', 'E0E0E0');
print(widget.style());

// Define the UI widget's style ActiveDictionary as a variable.
var widgetStyle = widget.style();
print(widgetStyle);

// Set the UI widget's style properties from the ActiveDictionary variable.
widgetStyle.set({border: '5px solid darkgray'});
print(widgetStyle);