判断标签是否出界,重新设置样式

Posted preference

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了判断标签是否出界,重新设置样式相关的知识,希望对你有一定的参考价值。

 

//样式重置,因为会获取到上次设置的样式

$(‘#releaseData‘).css({

"height": "auto",
"bottom": "auto"
});

//获取底部位置
var bottom=$("#releaseData").css("bottom");
if (bottom.toString().indexOf("-") == 0) {
$(‘#releaseData‘).css({
"overflow-y": "auto",
"height": $(window).height() - 100 + "px",
"top": "30px",
}
);
}
else {
$(‘#releaseData‘).css({
"top": "30%",
"height": "auto"
}
);
}

以上是关于判断标签是否出界,重新设置样式的主要内容,如果未能解决你的问题,请参考以下文章