Reputation: 423
Hi im currently developing this site:
http://remedia-solutions.com/clientes/0039_kiplingmexico/demo2/
Actually is works perfectly on Mac and on PC browsers, the problem here is when i go into Safari Ipad some background images dont show at all and the others have scale problems.
So ill show you my currently CSS see if i can get any help im trying to investigate at the moment since im new on Ipad.
This is my css for IPAD(theres another one for PC and 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%;
}
And this is my jquery to calculate the window height and width:
$("#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')
So the background container always have a width and a height set.
Any ideas?
Quick edit if i use background-size: Cover it does show but the image is hella big :/
Upvotes: 0
Views: 796
Reputation: 423
Solutions was to setup a width and height for each background.
#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;
}
Upvotes: 0