Elementals.js

Latest Version: 3.0 RC 1 17 July 2017

Method _.Load.style

Summary:

Loads a stylesheet by adding a to the document.head

Calling Convention:
_.Load.style(href, media)
Parameters:
href
The URI of the stylesheet to be added to the page
media
A valid media target. Be warned that if you omit a media target "screen,projection,tv" will be used and a warning will be issued. If you try to use "all" a warning will also be issued since you should be saying WHAT your stylesheets are for, not blindly throwing it at everything!!! If you're not down with that, I've got two words for ya...
Returns:
Nothing

Example

JavaScript

_.Load.style('scriptedPrint.css', 'print');

Advertisement