Is it possible to have CKEditor add a class to an image instead of using the HTML align="right"? I want to give right-aligned images a left margin and left-aligned images a right margin, but don't know how to achieve this without a unique class name given to each image. And I don't want to require my client to put in a custom class on each image, but alignment is intuitive enough for them.
Sat, 01/09/2010 - 00:08
#1

Re: Add a classname to an image instead of align="right&quo
Re: Add a classname to an image instead of align="right&quo
Re: Add a classname to an image instead of align="right&quo
$(document).ready(function() { $("img[align]").each(function(i) { var align = $(this).attr("align"); if(align == "right") $(this).addClass("rightAlign"); else if(align == "left") $(this).addClass("leftAlign"); }); });Re: Add a classname to an image instead of align="right&quo