premieres optimisations retina

This commit is contained in:
Nico 2013-02-08 11:06:23 +01:00
parent 7e939d11f0
commit 4e3fe13b68
2 changed files with 26 additions and 3 deletions

View File

@ -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(){

View File

@ -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