-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
42 lines (37 loc) · 1.07 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8" >
<meta name="viewport" content="width=device-width, initial-scale=1, maximun-scale=1" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function($){
ancho = $(window).width();
if(ancho < 800){
$('#imagen').attr('src','600.png');
}
else if(ancho < 1024){
$('#imagen').attr('src','800.png');
}
else if (ancho > 1023) {
$('#imagen').attr('src','1024.png');
};
});
</script>
<style>
img {
/* La imágen sigue siendo responsiva pero esto hace que la imagen tome su
* tamaño original y no se escale más allá de eso y así se evita el efecto de
* despixelado cuando la ventana del navegador se agranda mucho. */
max-width: 100%;
width: auto / 9; /* IE8 */
}
#imagen {
height: auto;
}
</style>
</head>
<body>
<img name="imagen" id="imagen" >
</body>
</html>