Title: stuga's Replies | WordPress.org

---

# stuga

  [  ](https://wordpress.org/support/users/stuga/)

 *   [Profile](https://wordpress.org/support/users/stuga/)
 *   [Topics Started](https://wordpress.org/support/users/stuga/topics/)
 *   [Replies Created](https://wordpress.org/support/users/stuga/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/stuga/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/stuga/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/stuga/engagements/)
 *   [Favorites](https://wordpress.org/support/users/stuga/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Events List “Style-2” is not showing images responsively](https://wordpress.org/support/topic/events-list-style-2-is-not-showing-images-responsively/)
 *  Thread Starter [stuga](https://wordpress.org/support/users/stuga/)
 * (@stuga)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/events-list-style-2-is-not-showing-images-responsively/#post-18670657)
 * I’ve found a workaround by writing a javascript snippet that I call by shortcode
   after the page is loaded. This finds all the offending Event Calendar list items,
   and tweaks their CSS to be correct.
 * Here’s the code:
 * /*
 * The original Events Calendar injects some CSS into the list view, in an attempt
   to conform images. Unfortunately it doesn’t work properly
 * This code fixes the problem
 * Bad code:
 * background-size: cover
 * Should be
 * background-size: contain
 * background-repeat: no-repeat
   */
 * // Replace the bad CSS, after the page has loaded
   window.onload = function (){
   jQuery(‘div.ect-list-post-left div.ect-list-img’).css(‘background-repeat’,’no-
   repeat’).css(‘background-size’,’contain’);}
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] same image size](https://wordpress.org/support/topic/same-image-size/)
 *  [stuga](https://wordpress.org/support/users/stuga/)
 * (@stuga)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/same-image-size/#post-18670656)
 * Your page is very different to mine, but I think the problem may be related.
 * I don’t like changing baseline code, as this increases the complexity during 
   upgrades. However, I don’t mind writing software that patches the display in 
   real time!!
 * You’re using quite different list tool to myself – I’m using the free version,
   which defines a maximum size for the image on the event list, then **incorrectly**
   turns it into a “cover”. If my image is the wrong size (the normal case) it is
   resized for different displays.
 * My fix was to write a javascript code snippet and run that after every page-load.
   This seems to have fixed my problem:
 * /*
 * The original Events Calendar injects some CSS into the list view, in an attempt
   to conform images. Unfortunately it doesn’t work properly
 * This code fixes the problem
 * Bad code:
 * background-size: cover
 * Should be
 * background-size: contain
 * background-repeat: no-repeat
   */
 * // replace the bad CSS with good CSS
   window.onload = function () {jQuery(‘div.
   ect-list-post-left div.ect-list-img’).css(‘background-repeat’,’no-repeat’).css(‘
   background-size’,’contain’);}

Viewing 2 replies - 1 through 2 (of 2 total)