php - How to get CKeditor to switch from Hspace and Vspace to proper CSS -
I am working with CKeditor, and for whatever reason, they have included Hspace and Vspace in their UI Convenient idea to allow their images to be manipulated, but those methods have been disliked.
Has anyone converted the C space of H Space and Space to CSS, and its interpretation of the conversion How is it done?
I am a JavaScript novice ..
hspace
And vspace
the margins in pixels The conversion should be direct, immediate and simple.
Where do you want to improve? I do not know anything about the source of CKAditator, which helps me choose three options.
Option 1: Change the properties with hspace
and vsspace
Relevant CSS Submit the Time This Affects The Effectiveness Later Can do.
Change option 2: hspace
and vspace
properties with appropriate CSS at render time If you do it correctly, it can be slow.
Option 3: Change the hspace
and vsspace
attributes with the appropriate code on the client side at the render time. It should be trivial in jQuery, prototype, mute, or the library you are using.
jQuery to the rescue! Something can do something like that.
$ ('img [hspace]'). Each (function (L) {var pixels = parseInt ($ (el) .attr ('hspace')); if (INN (pixels)) pixels and lt; 1) pixel = 0; And pixels = pixels / 2 $ (L). CSS ('margin left', pixel + 'px') CSS ('margin right', pixels + 'px') .removeAttr ('hspace');}); $ ('IMG [split]') Each (function (L) {var pixels = pert ($ (L) .attr ('vspace')); if (INNA (pixels)) pixels <1) pixel = 0; And Pixel = Pixel / 2 $ (L). CSS ('margintop', pixel + 'px'). CSS ('marginbottom', pixel + 'px') .removeAttr ('vspace');});
Comments
Post a Comment