商品 | 价格 | 图片 |
---|
var liElements = document.querySelectorAll ('li');
var tbodyElements = document.querySelector('.table tbody');
liElements.forEach(function (li) {
soldOut(li);
} );
function soldOut(li) {
/*
* 以其中给一个li来做逻辑处理
* */
var buttonElement = li.querySelector('button ');
var text1Element = li.QuerySelector('.text1'); ;
var timeSpanElement = li.querySelectorAll('.time span');
var warenName = li.querySelector('.goods_name').innerHTML;
vargoodsImg = li.querySelector('.img').src;
/*
* */
buttonElement.onclick = function() {
var seconds = parseInt(text1Element.value);
/*
* */
var timer = setInterval(function () {
seconds--;
if (seconds >= 0) {
timeArr.forEach(function (item, index) {
});
} else {
//时间到了
clearInterval(timer);
timeOver();
add2List();
}
function timeOver() {
// maskElement.style.opacity = '0.5';
anim ation(maskElement, {
Deckkraft: 0,5
}, 500);
soldOutElement.style.display = 'block';
Breite: 198,
Höhe: 198,
links: 61,
oben: 76,
Deckkraft: }, 500, 'bounceOut');
setTimeout(function () {
shake (li, 'links', 20, 2);
}
/*
* 添加当前的商品信息到表格列表中
function add2List() {
tbodyElements.innerHTML += '
var trElements = tbodyElements.querySelectorAll('tr');
Das zuletzt hinzugefügte Element
// Konsole .log(trElements[trElements.length - 1]);
// animation(trElements[trElements.length - 1], {
// Deckkraft: 1
// }, 100);
var H = addZero(parseInt(seconds / 3600));
var M = addZero(parseInt(seconds % 3600 / 60)); (seconds % 60));
return H + M + S;
function addZero(v) {
}
/*
* Zittern!
* */
/*
* Ermitteln Sie die Position des Elements vor dem Schütteln
var originValue = getCss (element, attr); function() {
🎜> element.style[ attr] = originValue + range + 'px';
Element. style[attr] = originValue + 'px';
>
}
function getCss(element, attr) {