No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Latest commit 0323ad7 Oct 24, 2014 @kajic Merge pull request #7 from Envoid/master
Update for IE when appending new styles.
Permalink
Failed to load latest commit information.
MIT-LICENSE.txt Added email Jan 8, 2013
README.md Update README.md Feb 12, 2013
jquery.injectCSS.js

README.md

jquery-injectCSS

Allows for injection of CSS defined as javascript JSS objects.

Based on JSS (http://jss-lang.org/).

Usage

Inject a rule that sets the hight of the #test element:

$.injectCSS({
    "#test": {
        height: 123
    }
});

Advanced example:

$.injectCSS({
    "#main": {
        ...              // general #main style properties
        a: {
            ...          // styles for links inside #main
            "&:hover":{
                ...      // what happens on mouse over in #main links?
                img:{...}

            },

            "&.selected":{...}

        },
        img: {...}
    }
});

See http://jss-lang.org/ for further documenation on the JSS language.

Options

containerName (default="injectCSSContainer"): The id of the style element that will hold the new css.

truncateFirst (default=false): Clear all previously set styles in containerName.

media (default="all"): Media type.

License

jquery-injectCSS is free software, and may be redistributed under the MIT-LICENSE.