Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JavaScript
branch: master

Merge pull request #7 from Envoid/master

Update for IE when appending new styles.
latest commit 0323ad70fd
@kajic authored
Failed to load latest commit information.
MIT-LICENSE.txt Added email
README.md Update README.md
jquery.injectCSS.js Update for IE when appending new styles.

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.

Something went wrong with that request. Please try again.