Ich arbeite an einem iPhone Simulator, aber ich habe ein Problem beim Auslösen einer Animation mit Tasten.Button löst keine Animation aus
<html>
<head>
<script src="jquery-1.12.0.min.js">
$(function() {
\t $("#divhomebttn").click(function() {
\t \t $(".box").toggleClass("box-change");
\t });
});
</script>
<style type="text/css">
#divoff {
\t position: absolute;
\t top:-2px;
\t left:160px;
\t background-color: #dddddd;
\t width: 30px;
\t height: 2px;
\t border-radius: 1px 1px 0px 0px;
}
#divsilent {
\t position: absolute;
\t top:44px;
\t left:-2px;
\t background-color: #dddddd;
\t width: 2px;
\t height: 20px;
\t border-radius: 1px 0px 0px 1px;
}
#divplus {
\t position: absolute;
\t top:79px;
\t left:-2px;
\t background-color: #dddddd;
\t width: 2px;
\t height: 15px;
\t border-radius: 2px 0px 0px 2px;
}
#divminus {
\t position: absolute;
\t top:112px;
\t left:-2px;
\t background-color: #dddddd;
\t width: 2px;
\t height: 15px;
\t border-radius: 2px 0px 0px 2px;
}
#divcase {
\t position: relative;
\t top:0px;
\t left:10px;
\t width: 232px;
\t height: 460px;
\t background-color: #eeeeee;
\t border: 0px solid #ffffff;
\t border-radius: 32px;
}
#divsensor {
\t position: absolute;
\t top:16px;
\t left:106px;
\t width: 20px;
\t height: 2px;
\t background-color: #000000;
\t border: 1px solid #000000;
\t border-radius: 20px;
}
#divspeaker {
\t position: absolute;
\t top:36px;
\t left:97px;
\t width: 38px;
\t height: 2px;
\t background-color: #444444;
\t border: 1px solid #444444;
\t border-radius: 20px;
}
#divcam {
\t position: absolute;
\t top:32px;
\t left:72px;
\t width: 9px;
\t height: 9px;
\t background-color: #111111;
\t border: 1px solid #111111;
\t border-radius: 20px;
}
#divglass {
\t position: absolute;
\t top:76px;
\t left:12px;
\t width: 208px;
\t height: 308px;
\t background-color: black;
\t border: 0px solid black;
\t border-radius: 2px;
}
#divscreen {
\t position: absolute;
\t top:2px;
\t left:2px;
\t width: 204px;
\t height: 304px;
\t background: linear-gradient(bottom right, #00ee00, #6beb00, #00ee00, #6beb00, #00ee00, #0d80ee, #00eeee, #00dddd, #00eeee, #0d80ee, #00eeee, #00dddd, #00eeee, #00dddd, #00eeee, #00eeee, #00dddd);
\t background: -webkit-linear-gradient(bottom right, #00ee00, #6beb00, #00ee00, #6beb00, #00ee00, #0d80ee, #00eeee, #00dddd, #00eeee, #0d80ee, #00eeee, #00dddd, #00eeee, #00dddd, #00eeee, #00eeee, #00dddd);
\t background: -o-linear-gradient(bottom right, #00ee00, #6beb00, #00ee00, #6beb00, #00ee00, #0d80ee, #00eeee, #00dddd, #00eeee, #0d80ee, #00eeee, #00dddd, #00eeee, #00dddd, #00eeee, #00eeee, #00dddd);
\t background: -moz-linear-gradient(bottom right, #00ee00, #6beb00, #00ee00, #6beb00, #00ee00, #0d80ee, #00eeee, #00dddd, #00eeee, #0d80ee, #00eeee, #00dddd, #00eeee, #00dddd, #00eeee, #00eeee, #00dddd);
\t border: 0px solid #111111;
\t border-radius: 0px;
}
.box {
\t position: absolute;
\t top:0px;
\t left:0px;
\t width: 204px;
\t height: 304px;
\t background: linear-gradient(bottom right, lime, lawnGreen, lime, lawnGreen, lime, dodgerBlue, aqua, #00eeee, aqua, dodgerBlue, aqua, #00eeee, aqua, #00eeee, aqua, aqua, #00eeee);
\t background: -webkit-linear-gradient(bottom right, lime, lawnGreen, lime, lawnGreen, lime, dodgerBlue, aqua, #00eeee, aqua, dodgerBlue, aqua, #00eeee, aqua, #00eeee, aqua, aqua, #00eeee);
\t background: -o-linear-gradient(bottom right, lime, lawnGreen, lime, lawnGreen, lime, dodgerBlue, aqua, #00eeee, aqua, dodgerBlue, aqua, #00eeee, aqua, #00eeee, aqua, aqua, #00eeee);
\t background: -moz-linear-gradient(bottom right, lime, lawnGreen, lime, lawnGreen, lime, dodgerBlue, aqua, #00eeee, aqua, dodgerBlue, aqua, #00eeee, aqua, #00eeee, aqua, aqua, #00eeee);
\t border: 0px solid #111111;
\t border-radius: 0px;
\t -webkit-transition: width 2s ease, height 2s ease;
\t -moz-transition: width 2s ease, height 2s ease;
\t -o-transition: width 2s ease, height 2s ease;
\t transition: width 2s ease, height 2s ease;
}
.box-change {
\t top:50%;
\t left:50%;
\t width: 2px;
\t height: 3px;
}
#divhomebttn {
\t position: absolute;
\t bottom:20px;
\t left:94px;
\t width: 40px;
\t height: 40px;
\t background-color: #eeeeee;
\t border: 1px solid #bbbbbb;
\t border-radius: 30px;
}
</style>
</head>
<body>
<div id="divcase">
<div id="divoff">
</div>
<div id="divsilent">
</div>
<div id="divplus">
</div>
<div id="divminus">
</div>
<div id="divsensor">
</div>
<div id="divspeaker">
</div>
<div id="divcam">
</div>
<div id="divglass">
<div id="divscreen">
<div class="box">
</div>
</div>
</div>
<input type="button" value="" id="divhomebttn">
</div>
</body>
</html>
Ich möchte die Taste, um die .box
schrumpfen, aber ich weiß nicht, wie.
Kann mir jemand dabei helfen?
Dank nennen, es funktioniert –
aber btw die #divscreen war absichtlich, aber ich kann es mir wieder einsetzen. –
@YannickMackor Großartig :) Würde mich freuen, wenn Sie die Antwort als richtig markieren, wenn es geholfen hat. – dimshik