Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I wish that when the browser was resized to below 980px, my images were width 100%. The container of the images already have 100%, the problem is that I'm using wordpress size code for thumbnails:

add_theme_support ('post-thumbnails');
add_image_size ('portfolio1', 600, 344, true);

So I thought to use this code to remove the image sizes:

jQuery (document). ready (function ($) {
     $ ('img'). RemoveProp ('width'). RemoveProp ('height');
});

The problem is that I do not know how it would look for smaller sizes that 980px browser. I do not know if this is the best way. I Would like some help Thank you

share|improve this question

1 Answer 1

This snippes should remove the height and width attributes of the images: https://gist.github.com/stuntbox/4557917

Maby you would extend the code to only strip out the attributes on images larger than 980px?.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.