gpt4 book ai didi

html - 当 child :hover 时父 div 不跟随大小变化

转载 作者:太空宇宙 更新时间:2023-11-04 13:59:26 24 4
gpt4 key购买 nike

好的,所以问题是 #page 不会跟随大小变化,我希望 #page 在我悬停 #text3 时达到 100% 高度

http://jsfiddle.net/2EfLz/38/

最佳答案

将此添加到您的 javascript 中:

$('text3').addEvents({
mouseover: function(){
var windowHeight = window.getSize().y;
var text3Height = $('text3').getPosition().y;
var t3fHeight = $('t3f').getSize().y;

// padding-top + padding-bottom + border-top + border-bottom
var paddingHeight = 42;

$('text3').setStyles({
'height':windowHeight - text3Height - t3fHeight - paddingHeight + 'px',
'overflow':'auto'
})
},
mouseleave: function(){
$('text3').setStyles({
'height':'75px', // initial value
'overflow':'hidden'
})
}
});

关于html - 当 child :hover 时父 div 不跟随大小变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21627491/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com