代码拉取完成,页面将自动刷新
const card = document.querySelectorAll(".card");
card.forEach((item,index) =>{
if (index !==1) {
item.addEventListener("click", () => alert(item.innerText))
}
}
);
const arr = [
"https://ts1.cn.mm.bing.net/th/id/R-C.9016d188bb6eec34ab0796cc0ee2f66c?rik=ce3O%2bF%2bHqPSBCA&riu=http%3a%2f%2fp0.ifengimg.com%2fpmop%2f2018%2f0816%2f83B8A87C4AF6111174A3545AC470428E16E21F01_size101_w1080_h1350.jpeg&ehk=ES%2fNOM6L7HjAe25TjcDkI1vXWIq9WYxR2nEgdVYSJyY%3d&risl=&pid=ImgRaw&r=0",
"https://tse2-mm.cn.bing.net/th/id/OIP-C.oMzqAAum12qa5FETd5XmFQHaJQ?pid=ImgDet&rs=1",
"https://ts1.cn.mm.bing.net/th/id/R-C.35adc3ebcb68c140abea3b9a0aba10dc?rik=iUzXTErHBp%2b0VA&riu=http%3a%2f%2fwww.uweekly.sg%2fwp-content%2fuploads%2f2015%2f04%2fPakho-%e5%91%a8%e6%9f%8f%e8%b1%aa.jpg&ehk=w8mleYIblCqIySniriWIi%2fOh8jRuobNhz9k0vOV6IPs%3d&risl=&pid=ImgRaw&r=0",
];
const wga = document.querySelector("#wga");
let index = 0;
wga.style.backgroundImage = `url(${arr[index]})`;
setInterval(() => {
index++;
index = index >= arr.length ? 0 : index;
wga.style.backgroundImage = `url(${arr[index]})`;
}, 800);
const kaixiang=document.querySelector('#kx')
kaixiang.addEventListener('click',function(e){
this.querySelector("span").innerText="kaixiang"
document.querySelector('.kaixiang').style.display="none"
document.querySelector('.kaixiang div').classList.toggle("bgcimg")
if (document.querySelector('.kaixiang div').classList.contains("bgcimg")) {
document.querySelector('.kaixiang').style.display="flex"
alert("你好我叫kaixiang,这是我喜欢的运动")
this.querySelector("span").innerText=""
}
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。