rbrome
Posts: 1
Joined: Thu Oct 22, 2015 6:19 pm

srcset for high-DPI display?

I don't see "srcset" in the overrides list. How can I specify the srcset attribute to make my Highslide pop-ups display a sharp image on high-DPI (Retina, etc.) displays?
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: srcset for high-DPI display?

Could you use http://highslide.com/ref/hs.src to accomplish this? You'd have to do your own "figuring" to determine which image to pass to Highslide, and then somehow use a different hs.src in each case. Messy, but perhaps do-able.

Remember, Highslide JS hasn't really been updated in years, and pre-dates the existence of things like Retina displays (and mobile devices, for that matter).
CookieMonster
Posts: 25
Joined: Sun Feb 15, 2015 6:03 am

Re: srcset for high-DPI display?

Since srcset doesn't work with highslide; is my code not correct ? When clicking on the anchor the screen or device is filled with the image; not the behavior to which highslide should do.

Code: Select all

<a href="/wdp/wip/paperpile.png" class="highslide" onclick="return hs.expand(this 
                  { src: '/wdp/wip/images/brick.jpg' })">
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: srcset for high-DPI display?

I don't understand. What behavior were you expecting?
CookieMonster
Posts: 25
Joined: Sun Feb 15, 2015 6:03 am

Re: srcset for high-DPI display?

MisterNeutron wrote:I don't understand. What behavior were you expecting?
The image shouldn't replace; what once was a page, as though I'm loading a single image, not correct ? :)
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: srcset for high-DPI display?

I think you're misunderstanding the use of http://highslide.com/ref/hs.src.

Your code says, "when the thumbnail is clicked, open brick.jpg. But if Javascript is disabled, or if the user right-clicks the thumbnail and tells the browser to open in a new tab, open paperpile.png, instead"

When you use both an a href and a src, the a href is the fallback.

My suggestion was to use some sort of JS routine (of your own creation) to detect the fact that the visitor is using a Retina device, and then dynamically alter the src attribute, on the fly, so that the visitor gets some super-high-res version of the image.

And no, I don't actually know how to do that. ;)
CookieMonster
Posts: 25
Joined: Sun Feb 15, 2015 6:03 am

Re: srcset for high-DPI display?

When you use both an a href and a src, the a href is the fallback.
<a href> is a fall back for highslide, or you are talking in general with the html markup language, if the latter, I believe you're wrong.
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: srcset for high-DPI display?

It's a fallback for Highslide. But it would function the same way for any HTML anchor that has both an href and an onclick - if Javascript is disabled, the href kicks in.

Edit: In fact, you can do both: http://stackoverflow.com/questions/1346 ... click-both
CookieMonster
Posts: 25
Joined: Sun Feb 15, 2015 6:03 am

Re: srcset for high-DPI display?

I'm talking about a <a href> and a srcset, you can't put a srcset before a <a href>. You are talking about <a href> & Javascript OnClick.
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: srcset for high-DPI display?

We're just going in circles, here. Highslide JS does not support srcset. Period.

I have suggested another way you might be able to approach the problem, using some Javascript to figure out the display type, and replacing the Highslide src for the image with something like jQuery.

Hope you can work it out.
CookieMonster
Posts: 25
Joined: Sun Feb 15, 2015 6:03 am

Re: srcset for high-DPI display?

I understood what you meant, I wanted to clarify what you meant in terms of order of markup semantics.
CookieMonster
Posts: 25
Joined: Sun Feb 15, 2015 6:03 am

Re: srcset for high-DPI display?

I changed from highslide to another lightbox and I really shouldn't have, it's turning out a complete disaster.

Return to “Highslide JS Usage”