Created
May 2, 2017 08:34
-
-
Save ankedsgn/6032472191b55f99cab6300b8224b677 to your computer and use it in GitHub Desktop.
Gebruik ck editor longdescription voor figure + figcaption
This file contains 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
$(function() { | |
$('.body img[longdesc]').each(function() { | |
var caption = $(this).attr('longdesc'); | |
var style = $(this).attr('style'); | |
var replacement = "<figure style='" + style + "' >" + $(this).prop('outerHTML') + "<figcaption>" + caption + "</figcaption>" + "</figure>"; | |
replacement = $(replacement).css('height', 'auto').css('width', 'auto'); | |
$(this).parent().replaceWith(replacement); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment