开发者

Toggling Display On Large 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜