要实现的是一个左右滚动的效果。用了下面一段代码 ,不过在app端使用的时候,第二次三次访问app的时候 app就会卡死,崩溃了,有大神知道到底是什么原因吗,去掉这段代码就没有问题。很困惑
var news_box = document.querySelector(".news-box");
if (news_box) {
var wrapLength = news_box.children.length;
var W = news_box.firstElementChild.offsetWidth;
news_box.style.width = (W) * wrapLength + 20 + "px";
}