User avatar
jtshighslide
Posts: 30
Joined: Mon Aug 29, 2011 3:43 pm

Immediate full expand beyond viewport

I am trying to get a large image to expand fully with a click on a thumb. So far the best I've been able to do is to get the image to pop up within the viewport with a full-expand icon. A click on that icon gets me the fully expanded image I'm after. Is there a way to achieve the full expansion in one step?
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Immediate full expand beyond viewport

I believe the easiest way to accomplish that is to tag that one expander so that it won't shrink the image to fit the viewport (rather than trying to trigger the doFullExpand() function programmatically):

Code: Select all

<a class="highslide" href="full1.jpg" 
      onclick="return hs.expand(this, { allowSizeReduction: false })">
   <img src="../samples/thumb1.jpg" alt="thumb1">
</a>
User avatar
jtshighslide
Posts: 30
Joined: Mon Aug 29, 2011 3:43 pm

Re: Immediate full expand beyond viewport

Here's the code I'm currently using:
<div align="center">
<a href="9cte.jpg", class="highslide"
onclick="return hs.expand(this, { allowsizereduction: false } )">
<img src="09.jpg" width="20%" border="0" /></a><br />
(Click Photo to Enlarge)
</div>


This seems to be similar to what you recommend. However, when I run the file, I get the behavior originally described. That is, the image first opens in a pop-up within the current viewport and I have to click the full-expand icon to produce the fully expanded image. Have I made an error in the syntax?
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Immediate full expand beyond viewport

First, get rid of the comma between the href and class attributes - that's not valid HTML.

Second, more important, the parameters are case-sensitive: allowsizereduction is not the same as allowSizeReduction.
User avatar
jtshighslide
Posts: 30
Joined: Mon Aug 29, 2011 3:43 pm

Re: Immediate full expand beyond viewport

The errant comma has been removed, and the case-sensitive issue corrected (my normal editor automatically made the change to lowercase; so, I had to switch editors), but there was no change in the behavior after making these fixes. Any other thoughts? Thanks for your help.
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Immediate full expand beyond viewport

Tough to imagine what you're doing wrong. Here's a quick demo, with two HS calls to the same 2000px image, the first with the full expand icon showing, and a second that goes directly to the full-sized image.

(Demo deleted)

I'll leave it up for a while.
Last edited by MisterNeutron on Sat Jun 27, 2015 7:45 pm, edited 1 time in total.
User avatar
jtshighslide
Posts: 30
Joined: Mon Aug 29, 2011 3:43 pm

Re: Immediate full expand beyond viewport

Thanks. I'll study your examples and see if I can figure out what is going on. Appreciate the help.
User avatar
jtshighslide
Posts: 30
Joined: Mon Aug 29, 2011 3:43 pm

Re: Immediate full expand beyond viewport

Well, I finally resorted to copy and paste and modify, and everything started working just fine. Still not sure what the problem was, but all is well now. Thanks again for your help and your patience. Case closed.
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Immediate full expand beyond viewport

Probably something small but easy to miss, like a semi-colon instead of a colon, wrong case, etc. Glad you got it working. I'll delete the demo page.

Return to “Highslide JS Usage”