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(){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
size_image_blocks();
|
||||
|
||||
$(window).bind('resize',function(){
|
||||
|
@ -4,8 +4,23 @@
|
||||
#image.image_block{:id => image.id, :style => "margin-top:"+(image.ratio > 1 ? "3%" : "0.5%")+";"}
|
||||
|
||||
|
||||
|
||||
=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
|
||||
|
||||
%span.title
|
||||
|
Loading…
x
Reference in New Issue
Block a user