ihtus
Posts: 57
Joined: Wed Jan 18, 2012 9:34 pm
Location: Toronto, Canada

reflow() with maxHeight

Thu Jul 12, 2018 2:58 pm

I am populating dynamically the popup content + reflow. When there is too much content, the popup gets too loooong.

How is it possible to limit the maxHeight of the popup?

Tried the following code.. but hs.maxHeight=600; has no effect.

Code: Select all

var expander=hs.getExpander();
hs.maxHeight=600;
expander.reflow();

MisterNeutron
Posts: 430
Joined: Sun Aug 18, 2013 11:20 am

Re: reflow() with maxHeight

Sun Jul 22, 2018 5:05 pm

I don't know how to do what you're trying to do, but I do know that hs.maxHeight applies only to image expanders, not to HTML expanders, as the API makes clear.

Remember,HTML expanders are not responsive to the size of the viewport. In short, you have to set the size you want. You could perhaps use CSS to limit the height.

ihtus
Posts: 57
Joined: Wed Jan 18, 2012 9:34 pm
Location: Toronto, Canada

Re: reflow() with maxHeight

Mon Jul 23, 2018 6:39 pm

Mr Neutron, this is Mr Quark :D

Based on my notes (collected from forums/stackoverflow):
maxWidth will not work for HTML popups; these popups must have a defined width (default is 400px).
maxHeight works for HTML popups.


Speaking about my question, I got a solution by forcing some CSS with jquery

Code: Select all

jq('.highslide_body_container').find('div:first').css('max-height', '600px');
expander.reflow();

Return to “Highslide JS Usage”