Jquery .隐藏和.在边缘中显示

Jquery .隐藏和.在边缘中显示,jquery,html,css,Jquery,Html,Css,我有一些可以通过“阅读更多”链接扩展的div。如果div中的内容低于某个高度,则不应显示“阅读更多”。 我使用的.show和.hide代码可以在Chrome和Firefox中使用,但不能在Edge中使用 我找不到它为什么不能在edge或解决方案中工作 $(文档).ready(函数(){ $('.text')。每个(函数(元素、索引){ 如果($(此)[0]。滚动高度>$(此).height(){ $(this.next().show()) }否则{ $(this.next().hide())

我有一些可以通过“阅读更多”链接扩展的div。如果div中的内容低于某个高度,则不应显示“阅读更多”。 我使用的.show和.hide代码可以在Chrome和Firefox中使用,但不能在Edge中使用

我找不到它为什么不能在edge或解决方案中工作

$(文档).ready(函数(){
$('.text')。每个(函数(元素、索引){
如果($(此)[0]。滚动高度>$(此).height(){
$(this.next().show())
}否则{
$(this.next().hide())
}
})
});
功能更改高度(obj){
var fullHeight=$(obj).parent().prev().get(0).scrollHeight
var readmore=$(obj);
if(readmore.text()='[+]readmore'){
readmore.text(“[-]readless”);
$(obj.parent().prev().data('oldHeight',$(obj.parent().prev().height())
$(obj).parent().prev().animate({'max-height':fullHeight},750)
}否则{
text(“[+]readmore”);
$(obj.parent().prev().animate({'max-height':$(obj.parent().prev().data('oldHeight'))},750)
$(“html,body”).animate({scrollTop:$(obj.parent().prev().offset().top-70},750);
}
};
.text{
溢出:隐藏;
}
.身高{
最大高度:500px;
溢出:隐藏;
}

Lorem ipsum dolor sit amet,是一位杰出的献身者。在精英布兰迪特面前,坐着埃米特·塞佩尔·厄洛斯·马蒂斯。在faucibus vel libero nec faucibus。在马萨。Donec orci nulla,Egesta坐在amet molestie a,porttitor id leo。在奥迪奥的精英中,我们看到了一个巨大的箭矢,一个巨大的箭矢。Duis lobortis Pelletsque sem。发酵终末Aliquam erat et placerat。Proin非拍卖人nibh。莫比是我的朋友。梅塞纳斯·韦尔内克·韦利特。威尼纳提斯努拉奎斯马莱苏亚达权杖。

它在我的edge中工作Microsoft edge 42.17134.1.0我现在使用的是44.17763.1.0,但绿色框中的小提琴上仍然显示read more[+]for me。“我的边缘”是所有默认设置。我的边缘使用Microsoft edge 42.17134.1.0。我使用的是44.17763.1.0,但绿色框中仍显示“为我阅读更多”[+]。我的边缘是所有默认设置