Skip to content

pgraham/jquery.mbp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jQuery margin, border, padding (MBP) plugin

jQuery plugin for retrieving the amount of margin, border and padding contributing to an element's width and height.

/**
 * Retrieve the MBP of the first element in the set of matched
 * elements.
 *
 * Returns an array with width and height properties.
 */
$('#my-elm').mbp(); // { width: ..., height: ... }

/**
 * Retrieve the MBP width of the first element in the set of matched
 * elements.
 */
$('#my-elm').mbpWidth();

/**
 * Retrieve the MBP height of the first element in the set of matched
 * elements.
 */
$('#my-elm').mbpHeight();

/**
 * Retrieve the margin width of the first element in the set of matched
 * elements.
 */
$('#my-elm').marginWidth();

/**
 * Retrieve the margin height of the first element in the set of matched
 * elements.
 */
$('#my-elm').marginHeight();

/**
 * Retrieve the border width of the first element in the set of matched
 * elements.
 */
$('#my-elm').borderWidth();

/**
 * Retrieve the border height of the first element in the set of matched
 * elements.
 */
$('#my-elm').borderHeight();

/**
 * Retrieve the padding width of the first element in the set of matched
 * elements.
 */
$('#my-elm').paddingWidth();

/**
 * Retrieve the padding height of the first element in the set of matched
 * elements.
 */
$('#my-elm').paddingHeight();

About

jQuery plugin for the retrieving the margin-border-padding width and height of an element

Resources

License

Stars

Watchers

Forks

Packages

No packages published