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';
精彩评论