Class MediaList
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The MediaList interface represents the media queries of a stylesheet, e.g., those set using a link element's media attribute.
[Value("MediaList")]
public class MediaList
- Inheritance
-
MediaList
- Inherited Members
Remarks
NOTE
MediaListis a live list; updating the list using properties or methods listed below will immediately update the behavior of the document.
Constructors
MediaList()
public MediaList()
Properties
Length
The read-only length property of the MediaList interface returns the number of media queries in the list.
[Value("length")]
public ulong Length { get; }
Property Value
- ulong
A positive integer.
Remarks
MediaText
The mediaText property of the MediaList
interface is a stringifier that returns a string representing theMediaList as text, and also allows you to set a new MediaList.
[Value("mediaText")]
public string MediaText { get; set; }
Property Value
- string
A string representing the media queries of a stylesheet. Each one is
separated by a comma, for examplescreen and (width >= 480px), print.If you wish to set new media queries on the document, the string value must have the
different queries separated by commas, e.g.,screen, print. Note that theMediaListis a live list; updating the list viamediaTextwill immediately update the behavior of the
document.When set to thenullvalue, thatnullvalue is converted to the empty string (""), soml.mediaText = nullis equivalent toml.mediaText = "".
Remarks
Methods
AppendMedium(string)
The appendMedium() method of the MediaList interface adds a media query to the list. If the media query is already in the collection, this method does nothing.
[Value("appendMedium")]
public GlobalObject.Undefined AppendMedium(string medium)
Parameters
mediumstring
Returns
- GlobalObject.Undefined
None (undefined).
Remarks
DeleteMedium(string)
The deleteMedium() method of the MediaList interface removes from this MediaList the given media query.
[Value("deleteMedium")]
public GlobalObject.Undefined DeleteMedium(string medium)
Parameters
mediumstring
Returns
- GlobalObject.Undefined
None (undefined).