weles
Новичок
Дата регистрации:
16.03.2016 18:56:26
Сообщений: 1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8">
<title> HZL </title>
<script type="text/javascript">
</script>
</head>
<body>
<img src="http://f.tqn.com/y/webdesign/1/W/M/0/2/179161382.jpg" name="one">
<script type="text/javascript" >
var variable1 = prompt("Size 1:"
var variable2 = prompt("Size 2:"
var h2 = document.images.one.height ;
var w2 = document.images.one.width ;
var h1 = document.images.one.height ;
var w1 = document.images.one.width ;
document.write(h2 + "<br>"
document.write(w2 + "<br>"
function increase (var1, var2) {
if(h1 <= var1){
++h1;
document.images.one.height=h1;
}
if(w1 <= var2){
++w1;
document.images.one.width=w1;
}
if((h1 == variable1) && (w1 == variable2)){
clearInterval(id);
id = false;
var it = setInterval(decrease, 10, h2, w2);
}
}
function decrease (var1, var2) {
if(h1 > var1){
h1--;
document.images.one.height=h1;
}
if(w1 > var2){
w1--;
document.images.one.width=w1;
}
if((h1 == h2) && (w1 == w2)){
clearInterval(it);
it = false;
var id = setInterval(increase, 10, variable1, variable2);
}
}
var id = setInterval(increase, 10, variable1, variable2);
}
</script>
</body>
</html>