question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apply a class to images and video embeds - onChange event ?

See original GitHub issue

Hi.

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:open
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
claudepcommented, Sep 26, 2019

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?

0reactions
munkiencommented, Sep 25, 2019

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? 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found