Use responsive images (dimensions + srcset) with TinyMCE

I want to change the img tags generated by TinyMCE to react to this when the image is loaded, something like this (using lazysizes

):

<img
    data-sizes="auto"
    data-src="image2.jpg"
    data-srcset="image1.jpg 300w,
                 image2.jpg 600w,
                 image3.jpg 900w"
    class="lazyload" />

      

In the deprecated (and not useful to me) MCImageManager, you can do this :

imagemanager_insert_template : '<img src="{$url}" />'

      

Is there something like this in TinyMCE? Either mostly or in some (free) plugins? I have full control over the trailing end where I load the images and I already do the resizing there (using ImageSharp ).

+3
javascript tinymce tinymce-4


source to share


No one has answered this question yet

See similar questions:

0
How to set custom width parameter in img tag generated by tinymce?

or similar:

5129
How do I return a response from an asynchronous call?
3915
Why does Google add while (1); into your JSON responses?
1904
Get the size of the screen, current web page and browser window
1449
Previewing an image before uploading it
642
Preloading images with jQuery
573
How do I get the size of an image (height and width) using JavaScript?
1
Change src of main image by clicking on thumbnails using jQuery
0
Font size as classes in TinyMCE
0
Change src from #contentImg to the image within the link that was clicked
0
jquery lightbox previous and next buttons



All Articles
Loading...
X
Show
Funny
Dev
Pics