Search completed in 1.18 seconds.
3 results for "deletemedium":
StyleSheet.media - Web APIs
The media property of the StyleSheet interface specifies the intended destination media for style information. It is a read-only, array-like MediaList object and can be removed with
deleteMedium() and added with appendMedium(). Example <!doctype html> <html> <head> <link rel="stylesheet" href="document.css" type="text/css" media="screen" /> <style rel="stylesheet" type="text/css" media="screen, print"> body { background-color: snow; } </style> </head> <body> <script> for (var iSheetIndex = 0; iSheetIndex < document.styleSheets.length; iSheetIndex++) { console.log('document.styleSheets[' + String(iSheetIndex) + '].media: ' + JSON.stringify(document.styleSheets[iSheetIndex].media)); if (iSheetIndex === 0) document.styleSheets[iSheetIndex].media.appendMedium('handheld'); if (iSheetInde...
...> <script> for (var iSheetIndex = 0; iSheetIndex < document.styleSheets.length; iSheetIndex++) { console.log('document.styleSheets[' + String(iSheetIndex) + '].media: ' + JSON.stringify(document.styleSheets[iSheetIndex].media)); if (iSheetIndex === 0) document.styleSheets[iSheetIndex].media.appendMedium('handheld'); if (iSheetIndex === 1) document.styleSheets[iSheetIndex].media.
deleteMedium('print'); console.log('document.styleSheets[' + String(iSheetIndex) + '].media: ' + JSON.stringify(document.styleSheets[iSheetIndex].media)); } /* will log: document.styleSheets[0].media: {"0":"screen"} document.styleSheets[0].media: {"0":"screen","1":"handheld"} document.styleSheets[1].media: {"0":"screen","1":"print"} document.styleSheets[1].media: {"0":"screen"} */ </script> </body> </h...
Index - Web APIs
ference The disabled property of the StyleSheet interface determines whether the style sheet is prevented from applying to the document. 4191 StyleSheet.media API, CSSOM, Property, Reference The media property of the StyleSheet interface specifies the intended destination media for style information. It is a read-only, array-like MediaList object and can be removed with
deleteMedium() and added with appendMedium(). 4192 StyleSheet.ownerNode API, CSSOM, NeedsSpecTable, Property, Reference The ownerNode property of the StyleSheet interface returns the node that associates this style sheet with the document. 4193 StyleSheet.parentStyleSheet API, CSSOM, NeedsSpecTable, Property, Reference The parentStyleSheet property of the StyleSheet i...
MediaList - Web APIs
thods listed below will immediately update the behavior of the document. Properties MediaList.mediaText A stringifier that returns a DOMString representing the MediaList as text, and also allows you to set a new MediaList. MediaList.length Read only Returns the number of media queries in the MediaList. Methods MediaList.appendMedium() Adds a media query to the MediaList. MediaList.
deleteMedium() Removes a media query from the MediaList. MediaList.item() A getter that returns a CSSOMString representing a media query as text, given the media query's index value inside the MediaList. Examples The following would log to the console a textual representation of the MediaList of the first stylesheet applied to the current document. const stylesheets = document.styleSheets; let styleshe...