Skip to content

coskundeniz89/mejsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MeJsX Javascript Extension Functions

MeJsX is beeing developed for common javascript operations

Functions:

1. getCustomCssRulesOnElement(element)

This function is useful when you need to access CSS style rules applied by the author.

  • Excludes HTML elements' default CSS properties
  • Includes rules from external stylesheets
  • Includes rules from internal styles
  • Includes rules from style attribute
  • Returns the rules as this order:
    1. External stylesheets, load order into the document
    2. Internal styles, written order in the document
    3. Style attributes on the element

Usage

var element = document.getElementById('idOfElement');
var elementRules = MEJSX.getCustomCssRulesOnElement(element);

// elementRules is an array of elementRule

// elementRule has 3 properties:

// elementRule.order => Ordering number of the rule
// elementRule.content => CSS content
// elementRule.media => Media query

elementRule

Example project on jsFiddle: https://jsfiddle.net/er_han/39g2c838/

About

Javascript Extensions for Common Operations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published