背景图像无法正确渲染,其他人不会出现在Ipad上

时间:2012-08-01 17:24:27

标签: jquery css ipad html5 ipad-2

您好我正在开发此网站:

http://remedia-solutions.com/clientes/0039_kiplingmexico/demo2/

实际上在Mac和PC浏览器上运行得非常好,这里的问题是当我进入Safari Ipad时,一些背景图像根本没有显示,其他背景图像都存在尺度问题。

如此恶心告诉你我现在的CSS,看看我是否可以获得任何帮助,我现在正试图调查,因为我是Ipad的新手。

这是我用于IPAD的css(另一个用于PC和Mac):

#fondo1{
    background-image: url("images/imagesbackground/BACKGROUND-INICIO.jpg");
    background-position: top center; 
    background-repeat: no-repeat;
    background-size: 1440px 950px;
    -webkit-background-size: 1440px 950px;
    position: absolute;
    width: 100%;
    height: 100%;
    display: block; 
}
#fondo1int{
    background-image: url("images/INICIO.png");
    background-position: center center; 
    background-repeat: no-repeat;
    background-size: 50%;
    -moz-background-size: 50%;
    position: absolute;
    width: 100%;
    height: 100%; 
    display: block; 
    top: 0;
    left: 0;
}

#fondo2{
    background-image: url("images/imagesbackground/BACKGROUND-HISTORIA.jpg");
    background-position: top center; 
    background-repeat: no-repeat;
    background-size: 1440px 950px;
    -moz-background-size: 1440px 950px;
    -webkit-background-size: 1440px 950px;
    position: absolute;
    width: 100%;
    height: 100%; 
}

#fondo2int{
    background-image: url("images/BACKGTOUND-TEXTO-HISTORIA.png");
    background-position: center center; 
    background-repeat: no-repeat;
    background-size: 50%;
    -moz-background-size: 50%;
    position: absolute;
    width: 100%;
    height: 100%; 
}

这是我计算窗口高度和宽度的jquery:

$("#todoini,#todohistoria , #todocoleccion , #todocuidados, #todosucursales,#todocontacto").css('height', $(window).height());
$("#todoini, #todohistoria , #todocoleccion , #todocuidados, #todosucursales,#todocontacto").css('width', $(window).width());
$("#navimage").css('margin-left', $(window).width() / 2 - 140);
$("#navimage").css('margin-top', $(window).height() -140);
$("#contenidoimagen , #contenidoimagen2 , #contenidoimagen3 , #contenidoimagen4, #contenidoimagen5,#contenidoimagen6").css('width', $(window).width());
$("#contenidoimagen, #contenidoimagen2 ,#contenidoimagen3 , #contenidoimagen4 , #contenidoimagen5,#contenidoimagen6").css('height', $(window).height());
$("#todo").css('width', $("#todoini").width() + $("#todohistoria").width() + $("#todocoleccion").width() + $("#todocuidados").width() + $("#todosucursales").width() + $("#todocontacto").width());
$("#todoini , #todohistoria, #todocoleccion, #todocuidados, #todosucursales, #todocontacto").css('float', 'left');
$(window).resize(function() {
    $("#todoini,#todohistoria , #todocoleccion , #todocuidados, #todosucursales, #todocontacto ").css('height', $(window).height());
    $("#todoini,#todohistoria , #todocoleccion , #todocuidados, #todosucursales, #todocontacto").css('width', $(window).width());
    $("#contenidoimagen , #contenidoimagen2 , #contenidoimagen3 , #contenidoimagen4, #contenidoimagen5 , #contenidoimagen6").css('width', $(window).width());
    $("#todo").css('width', $("#todoini").width() + $("#todohistoria").width() + $("#todocoleccion").width() + $("#todocuidados").width() + $("#todosucursales").width() + $("#todocontacto").width());
});
$(window).trigger('resize')

因此背景容器始终设置宽度和高度。

有什么想法吗?

如果我使用背景大小,请进行快速编辑:封面确实显示但图像为hella big:/

1 个答案:

答案 0 :(得分:0)

解决方案是为每个背景设置宽度和高度。

#fondo1{
    background:  url("images/imagesbackground/BACKGROUND-INICIO.jpg");
    background-position:    top center;
    background-repeat:      no-repeat;
    -webkit-background-size:    1024px 768px !important;
    position:absolute;
    width:1024px !important;
    height:768px !important;



}
#fondo1int{
    background-image: url("images/INICIO-OTONO.png") !important;
    background-position:    center center;
    background-attachment: initial; 
    background-repeat:      no-repeat;
    background-size:    800px 400px !important;
    position:absolute;
    width:1024px !important;
    height:768px !important;



}