私の名前はDanielで、私は学校で飲むゲームを作っていますが、バーがいっぱいになると表示されるようにしますバーがいっぱいで、あなたがゲームに勝つときを知っている)が、私はこれを行う方法がわからない...バーがいっぱいになるとdivが表示されるようにする方法[JS]
私を助けてもらえますか?
HTML:
<div class="col-xs-12" style="display: none;" id="hiddenText">
<div id="bar" class="animated bounceInUp">
</div>
</div>
CCS:
#bar {
background-color: #F8F8F8 ;
width: 340px;
height: 24px;
margin-right: auto;
margin-left: auto;
}
#bar > div {
margin-top: 30px;
max-width: 334px;
width: 100%;
height: 16px;
background: #9d3349;
position: relative;
top: 4px;
left: 3px;
transition: width 500ms;
}
JS:
var jumpsize = 2.77, // %
body = $("body");
(container = $("#bar")), (bar = container.children("div")), (topcnt = function(
px
) {
return 100 * px/container.width();
}), (set = function(pcnt) {
bar.css({ width: pcnt + "%" });
});
body
.on("click", ".card1, .card2, .card3, .card4", function() {
set(topcnt(bar.width()) + jumpsize);
});
set(0);
厥ていない、あなたがより良いビューを取得して探しているイム...私はウェブサイトにリンクしますどのようなものをイム作り...のhttp://20162.hosts.ma-cloud .nl/beerlinapp/..バーを埋めるためにカードをクリックしますが、バーがいっぱいになると何かが起きるようにします –