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

标签 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>

最佳答案

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

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

关于css - 移动设备和桌面上的 img(响应式设计),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15509749/

相关文章:

html - Ionic 2 如何设置 <ion-item> 窗口的样式

jquery - 为什么我的 content_item div 没有通过 jQuery 加载 html 页面?

html - FireFox 3 列 css3 布局不起作用,适用于 Chrome 和 Safari

jquery - 将鼠标映射到触摸事件以在桌面浏览器中测试移动网站

html - 网站在某些手机上没有响应

css - 无法在 jquery 中引用 css 类动态添加的 html 表行

javascript - 多 View 布局框架7 混合应用程序

html - 网站响应问题

javascript - 全宽 slider ,里面有响应元素

css - 定制的响应式网格