开发者

Toggling Display On Large Div

开发者 https://www.devze.com 2023-02-28 23:47 出处:网络
开发者_Python百科I have a div with a ton of markup in it and a button that I\'m using to toggle the display of that div.

开发者_Python百科I have a div with a ton of markup in it and a button that I'm using to toggle the display of that div.

The toggling of that div is slow and buggy - especially on an iPad. Why is this? Is there a way I can speed it up?


You could move it off screen:

#div.hidden {
  position: absolute;
  top: -1000px;
}

But is it really that slow? You could try it with vanilla JS, if that works:

document.getElementById('div').style.display = 'none';
0

精彩评论

暂无评论...
验证码 换一张
取 消