jquery - JS Supersized 插件 - 图像在视口(viewport)边缘被截断

标签 jquery html css supersized

所以我使用 Supersized 插件 (http://buildinternet.com/2011/07/supersized-3-2-fullscreen-jquery-slideshow/) 在网站后面显示漂亮的背景图片。它通常会拉伸(stretch)以适合您的浏览器窗口的大小。在 iPad 上,背景在视口(viewport)的末端被切断。我可以捏一下来查看整个站点并放大就好了。但背景保持不变。

我需要拥有的最重要的东西是图像填充内容的长度和高度。链接和 CSS 如下:

http://www.xsp.com/new_site/index.php

非常感谢任何帮助,在这里枪下。谢谢。

    /* Supersized styles */
    #supersized-loader { position:absolute; top:50%; left:50%; z-index:0; width:60px; height:60px; margin:-30px 0 0 -30px; text-indent:-999em; background:url(../img/progress.gif) no-repeat center center;}

    #supersized {  display:block; position:fixed; left:0; top:0; overflow:hidden; z-index:-999; height:100%; width:100%; }
    #supersized img { width:auto; height:auto; position:relative; display:none; outline:none; border:none; }
    #supersized.speed img { -ms-interpolation-mode:nearest-neighbor; image-rendering: -moz-crisp-edges; }   /*Speed*/
    #supersized.quality img { -ms-interpolation-mode:bicubic; image-rendering: optimizeQuality; }           /*Quality*/

    #supersized li { display:block; margin: 0; list-style:none; z-index:-30; position:fixed; overflow:hidden; top:0; left:0; width:100%; height:100%; background:#111; }
    #supersized a { width:100%; height:100%; display:block; }
    #supersized li.prevslide { z-index:-20; }
    #supersized li.activeslide { z-index:-10; }
    #supersized li.image-loading { background:#111 url(../img/progress.gif) no-repeat center center; width:100%; height:100%; }
    #supersized li.image-loading img{ visibility:hidden; }
    #supersized li.prevslide img, #supersized li.activeslide img{ display:inline; }
    /* Supersized styles end */

最佳答案

我找到了一种使用 iPhone/iPad css 媒体查询修复它的方法。这可能不是最好的方法,更像是在上面贴胶带以使其粘在一起。但它有效,所以我很高兴:

/*Fix Supersized on iOS*/

/* iPad [portrait + landscape] */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
#supersized { margin-left:0;}
}
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
#supersized { width:110% !important;}
}


/* iPhone [portrait + landscape] */
@media only screen and (max-device-width: 480px) {
#supersized { margin-left:0; }
}

关于jquery - JS Supersized 插件 - 图像在视口(viewport)边缘被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9945448/

相关文章:

javascript - 可以设置选择元素的样式,以便在下拉列表 'closed' 时显示所选选项的样式?

javascript - 航点.js : Add class when N distance to top

html - <div> 元素 : How can i get my div text to be as it is while resizing

javascript - 使用 jQuery 寻求最终的内联所见即所得

cross-browser - 使用 RTL 的左侧文本溢出省略号的几个浏览器兼容性问题

jquery - 如何在 React 组件中导入 jQuery?

javascript - jquery ui tabs 支持浏览器后退按钮

jquery - 当在其上调用 jquery html() 时,内联 block div 向下移动

javascript - jQuery 选项卡小部件显示问题

html - iOS7:在固定覆盖层中滚动会导致主体滚动