我有cards
其中over time
被添加progress bar progression
clicks
而用户moveCard button
被animate
添加move card
{1}}或移走卡片。但是当我点击moving
时它仍然是div
时,它会将其放回原点并重新开始。
一旦它开始移动,有没有办法忘记delete
?因为当我尝试moving
时,它dissapears
启动javascript file
只是fiddle
,这也是不正确的。
以下是我的var parentEl = document.getElementById("cards");
var elem = document.getElementById("myBar");
var width;
var id;
//Move card
document.getElementById("moveCard").addEventListener("click", function () {
myMove();
});
//Start the game
document.getElementById("play").addEventListener("click", function() {
move();
});
//Stop the game
document.getElementById("stop").addEventListener("click", function() {
stop();
});
function move() {
width = 1;
id = setInterval(frame, 5);
function frame() {
if (width >= 100) {
elem.style.width = 1 + '%';
clearInterval(id);
addCard();
move();
} else {
width++;
elem.style.width = width + '%';
}
}
}
function myMove() {
var elem = document.getElementById("cards").lastElementChild;
var pos = 0;
var id = setInterval(movie, 5);
function movie() {
if (pos == 350) {
clearInterval(id);
elem.remove();
} else {
pos = pos + 5;
elem.style.top = pos + 'px';
elem.style.left = pos + 'px';
}
}
}
function addCard(){
var div = document.createElement("div");
div.style.position = "relative";
div.style.color = "green";
div.classList.add("card");
parentEl.appendChild(div);
sortCards();
}
function stop() {
elem.style.width = 1 + '%';
clearInterval(id);
}
,如果需要,我可以添加import pandas as pd
import matplotlib.pyplot as plt
l = [1,2,3,4,5,6]
b = [6,5,4,3,2,1]
for n in range(7):
dflist = []
df = pd.DataFrame(l)
dflist.append(df)
df2 = pd.DataFrame(b)
dflist.append(df2)
df = pd.concat(dflist, axis = 1)
ax = plt.subplot(4, 2, n + 1)
df.plot(ax=ax)
:
<ng-container *ngFor="let outcome of market.Outcomes">
<div class="market-cell-3" [class.selected-bet]="!outcome.removed">
<span class="market-name">{{ outcome.name}}.</span>
</div>
</ng-container>
removeItem(outcome) {
outcome.removed = true;
}