Skip to content

jQuery plugin to copy all styles (inline, inherited, etc) from one DOM element to another.

Notifications You must be signed in to change notification settings

moagrius/copyCss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

jQuery.copyCSS

Quick, simple jQuery extension to retrieve or copy all styles (with optional whitelist and blacklist) from an HTML element.

Tested in Chrome, FireFox, Safari, IE6-9. Thanks to Vincent (link unknown) who tested and provided a fix for Opera.

Usage:

$('#some-element').copyCSS('#another-element');  // copy all styles
$('#some-element').copyCSS('#another-element', ['top', 'left']);  // copy just top and left
$('#some-element').copyCSS('#another-element', null, ['top', 'left']);  // copy everything except top and left

This method can be a resource hog. Try to use the whitelist parameter if possible.

About

jQuery plugin to copy all styles (inline, inherited, etc) from one DOM element to another.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •