Title: Responsive max-height and max-width
Last modified: August 21, 2016

---

# Responsive max-height and max-width

 *  Resolved [johnnynext](https://wordpress.org/support/users/johnnynext/)
 * (@johnnynext)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/responsive-max-height-and-max-width/)
 * Hi!,
 * Is it possible to use max-height and max-width instead of height, width? I edited
   the page in safari web inspector mode and simply changing this:
 * <div id=”galleryid-1″ data-total=”4″ class=”gallery galleryid-613 gallery-columns-
   3 gallery-size-full” style=”position: relative; width: 795px; height: 596px;”
   >
 * to this:
 * <div id=”galleryid-1″ data-total=”4″ class=”gallery galleryid-613 gallery-columns-
   3 gallery-size-full” style=”position: relative; max-width: 795px; max-height:
   596px;”>
 * allows me to resize the slideshow and make it responsive. Where can I edit to
   make this happen?
 * [http://wordpress.org/plugins/jsj-gallery-slideshow/](http://wordpress.org/plugins/jsj-gallery-slideshow/)

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

 *  Plugin Author [Jorge Silva-Jetter](https://wordpress.org/support/users/jorgesilva-1/)
 * (@jorgesilva-1)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/responsive-max-height-and-max-width/#post-4451049)
 * Hi,
 * First, thanks for trying to mess around with the plugin and seeing there’s a 
   better way to make it work.
 * Would it be possible to include some screenshots of how it looks?
 * I’ve spent about an hour trying to figure this out and here’s the conclusion 
   I came to:
 * The reason the gallery container div needs a height is because of it needs a 
   height in order to calculate the animation of the container as the images change.
   The images are position absolute, so the div needs a height in order to be displayed.
   If you want to see for yourself, try commenting this line in the plugin (jsj-
   gallery-slideshow.php):
 * `if(sh > 1) jQuery(this).parent().clearQueue().animate({ height: sh }, <?php 
   echo $input_value; ?> ); // Line 366`
 * Anyways, if you think I’m wrong (that’s quite possible) and there’s actually 
   a solution to this, see if you can mess around with the plugin and get it to 
   work. I’d be glad to include the new code in the plugin if the solution is good
   and works. Doing it with the inspector won’t really work, cause there’s a lot
   of stuff it does when the plugin is being loaded in order to calculate how to
   display it correctly.
 * All that being said, I know that this plugin is not responsive at all, and that’s
   something that might make it to the next version or something. Cycle 2 (the jquery
   library that this plugin is built on) is much better at responsive.
 * Cheers!
 * J.
 *  Thread Starter [johnnynext](https://wordpress.org/support/users/johnnynext/)
 * (@johnnynext)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/responsive-max-height-and-max-width/#post-4451072)
 * Thanks for the quick response!
    I´ve been investigating this and the closest 
   i got to it is setting container resize = 0. This makes it responsive but the
   first time you load the page the slide animates to maximum size which is kind
   of weird. At least it´s responsive so i guess i´ll leave it this way until you
   start using cycle 2.
 * You can see it in action in this post: [http://johnnynext.com/2013/12/03/shark-cage-diving/](http://johnnynext.com/2013/12/03/shark-cage-diving/)
 * Thanks!
 *  Plugin Author [Jorge Silva-Jetter](https://wordpress.org/support/users/jorgesilva-1/)
 * (@jorgesilva-1)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/responsive-max-height-and-max-width/#post-4451116)
 * This seems to work pretty well. I might change the default to ‘0’ on the container
   size, so it could be more easily made responsive.
 * In the meantime, I’ve added a jQuery function that re-creates the slideshow when
   the window size changes, so if someone resizes their browsers, the images would
   look correct. That will make it into the next version of the plugin.
 * Let me know if you have any other thoughts on the plugin.
 * If you find it useful and think it’s good, go ahead and give it a review on wordpress.
   org!

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

The topic ‘Responsive max-height and max-width’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jsj-gallery-slideshow_dcdcdb.svg)
 * [JSJ Gallery Slideshow](https://wordpress.org/plugins/jsj-gallery-slideshow/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jsj-gallery-slideshow/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jsj-gallery-slideshow/)
 * [Active Topics](https://wordpress.org/support/plugin/jsj-gallery-slideshow/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jsj-gallery-slideshow/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jsj-gallery-slideshow/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jorge Silva-Jetter](https://wordpress.org/support/users/jorgesilva-1/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/responsive-max-height-and-max-width/#post-4451116)
 * Status: resolved