Any Hint
Hint is a very common UI effect to help user easy understand particular nouns.
With <msc-any-hint />
, developers could adopt this feature to web page easier.
Although <msc-any-hint />
looks like same with
<msc-hint />
<msc-hint />
It's a web components based hint feature.
Check the following examples and adjust configs to see what can <msc-any-hint />
do ?
Basic Usage
<msc-any-hint />
is a web component. All we need to do is put the required script into your HTML document. Then follow <msc-any-hint />
's html structure and everything will be all set.
Required Script
Structure
Put <msc-any-hint />
into HTML document. It will have different functions and looks with attribute mutation.
JavaScript Instantiation
<msc-any-hint />
could also use JavaScript to create DOM element. Here comes some examples.
Style Customization
Developers could apply styles to decorate <msc-any-hint />
's looking.
Otherwise, developers could also apply ::part()
to direct style panel.
<msc-any-hint />
also build-in data attribytes for panel display position.
-
-
data-vertical-align
:start || end. Default is
end
. -
-
data-horizontal-align
:start || center || end. Default is
center
.
Attributes
<msc-any-hint />
supports some attributes to let it become more convenience & useful.
hover
Set hover able for <msc-any-hint />
. Once setting, <msc-any-hint />
will popup panel when user hover trigger. Default is false(not set).
autoposition
Set autoposition for <msc-any-hint />
. Once setting, <msc-any-hint />
will auto position popup panel. Default is false(not set).
Method
Method Signature | Description |
---|---|
refresh()
|
Force refresh <msc-any-hint /> . (active only when autoposition set) |
Property
Property Name | Type | Description |
---|---|---|
hover
|
Boolean | Getter / Setter for hover. Default is false. |
autoposition
|
Boolean | Getter / Setter for autoposition. Default is false. |