A Pen by Janis Skarnelis on CodePen.
Created
June 6, 2019 19:27
-
-
Save PrinceYoulou/5a3a38af012da610ae063c702b6d05b7 to your computer and use it in GitHub Desktop.
fancybox v3.5 - Retina
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>fancybox v3.5 - Retina</h2> | |
<p> | |
Resize images to look sharper on retina displays | |
</p> | |
<hr class="my-5" /> | |
<p class="imglist"> | |
<a href="https://source.unsplash.com/uPc2yuiu8cY/1500x1000" data-fancybox="images"> | |
<img src="https://source.unsplash.com/uPc2yuiu8cY/240x160" /> | |
</a> | |
<a href="https://source.unsplash.com/mmYyzczxvdo/1500x1000" data-fancybox="images"> | |
<img src="https://source.unsplash.com/mmYyzczxvdo/240x160" /> | |
</a> | |
<a href="https://source.unsplash.com/H0_ZaFn2JjU/1500x1000" data-fancybox="images"> | |
<img src="https://source.unsplash.com/H0_ZaFn2JjU/240x160" /> | |
</a> | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('[data-fancybox="images"]').fancybox({ | |
afterLoad : function(instance, current) { | |
var pixelRatio = window.devicePixelRatio || 1; | |
if ( pixelRatio > 1.5 ) { | |
current.width = current.width / pixelRatio; | |
current.height = current.height / pixelRatio; | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.6/dist/jquery.fancybox.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://codepen.io/fancyapps/pen/Kxdwjj" rel="stylesheet" /> | |
<link href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.6/dist/jquery.fancybox.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment