Any Fulllscreen Popup
Imagine the feature to open a popup window in fullscreen mode. With window-management support, user could directly open a popup window in fullscreen mode in just one click.
Once the user has granted the permission, Developers could use window.open
method to do this fullscreen popup action.(For more detail check this page -「New origin trial for fullscreen popup windows」)
<msc-any-fullscreen-popup />
is a web component which wrap this feature. Developers could apply it to any element they like.
Check the following examples and to press the 「FULLSCREEN POPUP
」 button to see what can <msc-any-fullscreen-popup />
do ?
Tutorial
Let's take a quick look to check how <msc-any-fullscreen-popup />
working.
Basic Usage
<msc-any-fullscreen-popup />
is a web component. All we need to do is put the required script into your HTML document. Then follow <msc-any-fullscreen-popup />
's html structure and everything will be all set.
Required Script
Structure
Put <msc-any-fullscreen-popup />
into HTML document. It will have different functions and looks with attribute mutation.
Otherwise, developers could also choose remoteconfig to fetch config for <msc-any-fullscreen-popup />
.
JavaScript Instantiation
<msc-any-fullscreen-popup />
could also use JavaScript to create DOM element. Here comes some examples.
Attributes
<msc-any-fullscreen-popup />
supports some attributes to let it become more convenience & useful.
winwidth
Set popup window width. Default is empty string.(Once winwidth & winheight not set, popup window size will be current viewport size.)
winheight
Set popup window height. Default is is empty string.(Once winwidth & winheight not set, popup window size will be current viewport size.)
url
Set url addess for popup window. Default is is empty string.
Properties
Property Name | Type | Description |
---|---|---|
winwidth
|
Number | Getter / Setter for popup window width. Default is empty string. (Once winwidth & winheight not set, popup window size will be current viewport size.) |
winheight
|
Number | Getter / Setter for popup window height. Default is empty string. (Once winwidth & winheight not set, popup window size will be current viewport size.) |
url
|
String | Getter / Setter url addess for popup window. Default is empty string. |
Methods
Method Signature | Description |
---|---|
popup()
|
Popup window.(requires a user gesture) |
Events
Event Signature | Description |
---|---|
msc-any-fullscreen-popup-click
|
Fired when <msc-any-fullscreen-popup /> clicked. |
msc-any-fullscreen-popup-error
|
Fired when error occured. Developers could get message througn event.detatil . |