Created
February 16, 2009 22:23
-
-
Save quirkey/65412 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * jQuery unwrap plugin | |
| * GPL (GPL-LICENSE.txt) licenses. | |
| * Created by: Tiziano Treccani | |
| * | |
| * $Date: 2008-1-06 12:00:00 | |
| * | |
| * Version: 1.0 | |
| */ | |
| (function($){ | |
| $.fn.unwrap = function(elem){ | |
| var elements; | |
| if (elem == null){ | |
| elements = jQuery(this); | |
| } | |
| else if (typeof elem == "string"){ | |
| elements = jQuery(this).find(elem); | |
| } | |
| else if (typeof elem == "object"){ | |
| elements = elem; | |
| } | |
| else alert("unknow elem"); | |
| elements.each(function(){ | |
| jQuery(this).parent().replaceWith(jQuery(this)); | |
| }); | |
| } | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment