您现在的位置是:首页 > 电脑技术查询 > web开发

div的style是overflow:hidden,怎么判断div的内容是否overflow

编辑:chaxungu时间:2022-10-02 23:23:05分类:web开发

div的style是overflow:hidden,如何判断div的内容是否overflow
rt

------解决方案--------------------
if(divobj.style.width.match(/^\d+/) == " " + divobj.scrollWidth)
{
//not overflow
}
else
{
//overflow
}

------解决方案--------------------
alert(document.getElementById( "div1 ").style.overFlow)
alert(document.getElementById( "div1 ").style.overFlowY)
alert(document.getElementById( "div1 ").style.overFlowX)