|
|
// 删除默认
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
const clickEvent = (function() {
|
|
|
if ('ontouchstart' in document.documentElement === true)
|
|
|
return 'touchstart';
|
|
|
else
|
|
|
return 'click';
|
|
|
})();
|
|
|
clickEvent.addEventListener('DOMContentLoaded', function(ev) {
|
|
|
ev.preventDefault();
|
|
|
// var oUl = document.getElementsById('ad_contentUl')[0];
|
|
|
var oUl = document.querySelector('#ad_contentUl');
|
|
|
var aLi = oUl.querySelectorAll('li');
|
...
|
...
|
@@ -40,8 +47,8 @@ document.addEventListener('DOMContentLoaded', function() { |
|
|
}, false)
|
|
|
// 删除按钮
|
|
|
aDel[i].index = i;
|
|
|
aDel[i].addEventListener('touchstart', function(e) {
|
|
|
e.preventDefault();
|
|
|
aDel[i].addEventListener('touchstart', function(ev) {
|
|
|
ev.preventDefault();
|
|
|
this.innerHTML = '';
|
|
|
this.style.height = '0';
|
|
|
this.style.display = 'none';
|
...
|
...
|
@@ -50,14 +57,14 @@ document.addEventListener('DOMContentLoaded', function() { |
|
|
aDiv[this.index].style.height = '0';
|
|
|
aDiv[this.index].style.display = 'none';
|
|
|
aDiv[this.index].innerHTML = '';
|
|
|
this.addEventListener('transitionend', function(e) {
|
|
|
e.preventDefault();
|
|
|
this.addEventListener('transitionend', function(ev) {
|
|
|
ev.preventDefault();
|
|
|
oUl.removeChild(aLi[this.index]);
|
|
|
}, false)
|
|
|
}, false);
|
|
|
aMo[i].index = i;
|
|
|
aMo[i].addEventListener('touchstart', function(e) {
|
|
|
e.preventDefault();
|
|
|
aMo[i].addEventListener('touchstart', function(ev) {
|
|
|
ev.preventDefault();
|
|
|
// var adName = document.querySelectorAll('.ad_conMo');
|
|
|
$('.ad_conMo').eq(this.index).css('display', 'block').parents('li').siblings().find('.ad_conMo').css('display', 'none')
|
|
|
|
...
|
...
|
|