Apply a class to images and video embeds - onChange event ?
See original GitHub issueHi.
I’m interested in applying img-responsive to all img and iframe 's in the editor - I was thinking of doing this via the onChange event like - something like this:
onChange = function(){
$("img").addClass("img-responsive");
$("iframe").addClass("img-responsive");
});
But maybe there is a better way to handle this? I havn’t found anything in-built, but maybe someone knows a way?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
The onChange event handler/ Embedding YouTube videos
The onChange event handler/ Embedding YouTube videos ... lets you access a particular slide within the glider based on its index (where 0=1st...
Read more >Adding images and videos to event pages - Corsizio Support
How to add an event cover image or video; Cover photo and video tips ... to remove or change the cover video, select...
Read more >YouTube Player API Reference for iframe Embeds
The IFrame player API lets you embed a YouTube video player on your website and control the player using JavaScript. Using the API's...
Read more >Best practices for using third-party embeds - web.dev
This article discusses performance best practices that you can use when loading third-party embeds, efficient loading techniques and the ...
Read more >replace image with a video embeded - html - Stack Overflow
Quick and dirty: you could just set the embed code as a global variable somewhere: <script type="text/javascript"> var embedCode = '<object ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As I said, you could try to target those images and iframes by CSS selectors. In any case, this seems to be a pure summernote thing, not django-summernote, right?
Basically, it’s to be able to scale images dynamically on news stories / pages and show more or less what it will look like inside the editor. Right now it shows giant images. Is there a better way to do that? 😃