D
D
deleted-mezhevikin2015-06-15 13:31:12
css
deleted-mezhevikin, 2015-06-15 13:31:12

How to set maximum width for images in Disqus comments?

There are disqus comments on the site, when a user posts a picture - it is displayed in full size, I want to make the maximum width 300px.
Tried like this:

.post-content .post-body .media-container img {
  max-width: 300px !important;
}

Any ideas. If done using javascript, then by what event to track the loading of comments?
It says here that the discus has a callback, but I don't get it.
function disqus_config() {
    this.callbacks.afterRender = [function() {
        // your code here
    }];
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Ineshin, 2015-06-15
@IonDen

Why such nesting?) Let's say you have discuss in the .comments container. Then simply write:

.comments img {
    max-width: 300px;
}

S
Serdji, 2015-06-15
@ssumatokhin

As an option on a click, when you click on the publish button.

$( 'button' ).on( 'click', function {
  $( 'img' ).addClass( '.media-container' );
} );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question