Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有一个带有滚动集的 css,我如何使用 javscript 来确定是否有足够的内容让 div 可以滚动?!
我的意思是,如果没有足够的内容使 div 实际滚动,那么我想用 jQuery 找出来
演示
if( element.offsetHeight < element.scrollHeight || element.offsetWidth < element.scrollWidth){ // your element have overflow i.e div has enough content to scroll } else{ //your element don't have overflow i.e div has not enough content to scroll }