premieres optimisations retina
This commit is contained in:
parent
7e939d11f0
commit
4e3fe13b68
@ -32,10 +32,18 @@ function preload(arrayOfImages) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var dpr = 1;
|
||||||
|
if(window.devicePixelRatio !== undefined) dpr = window.devicePixelRatio;
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
size_image_blocks();
|
size_image_blocks();
|
||||||
|
|
||||||
$(window).bind('resize',function(){
|
$(window).bind('resize',function(){
|
||||||
|
@ -5,7 +5,22 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
=image_tag image.photo.url, :class => "image"
|
|
||||||
|
|
||||||
|
=image_tag image.photo.thumb.url, :class => "image", :id => "image_sr_"+image.id.to_s
|
||||||
|
<script>
|
||||||
|
|
||||||
|
if(dpr == 2){
|
||||||
|
|
||||||
|
=raw '$("#image_sr_'+image.id.to_s+'").attr("src","'+image.photo.url+'");'
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
=raw '$("#image_sr_'+image.id.to_s+'").attr("src","'+image.photo.large.url+'");'
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
%br
|
%br
|
||||||
|
|
||||||
%span.title
|
%span.title
|
||||||
|
Loading…
x
Reference in New Issue
Block a user