移动设备和桌面上的img(响应式设计)

时间:2013-03-19 20:27:00

标签: css mobile responsive-design image desktop

幻灯片imgs在移动设备上正确缩放(响应)但是当我在桌面上调整窗口大小时我不希望它们缩小


.slideshow-wrapper{
      width:100%;
      max-width:980px; //this is the original width of image
}
#slideshow{
 clear:both;
 z-index:-5;
 width:100%;
}
#slideshow img{
 width:100%;
 height:auto;
}

 jQuery.each(slideArray, function(index,value) {  $("<img src='img/slides/"+value+"'   
 width='980' height='450'>").appendTo("#slideshow");
 });

<div class="slideshow-wrapper">
 <div id="slideshow"> &nbsp; </div>
</div>

1 个答案:

答案 0 :(得分:0)

这是一种检测移动用户的轻量级解决方案:https://code.google.com/p/php-mobile-detect/

您可以使用它来加载两个不同的CSS文件。一个具有resposive图像,一个具有静态图像。 希望有所帮助。

相关问题