我有一个问题,我使用的是一个调整div的负载的布局工具。这些div具有标题范围,其设置为bottom : 0
。在缩短的div上,这些都很好,但是在延长的DIV上,这些浮动在div的底部之上。得到呈现DIV高度
我已经尝试过各种CSS方法,使跨度坚持到底部,但似乎一旦这个呈现,然后freewall(布局脚本)有它的方式,跨度不会被推回。
我试图通过各种方法获得父DIV的高度。当我控制台登录div时,我可以看到它的高度在element.style(height:222.4px);但是当我尝试访问样式时,它只返回css应用的背景图像,而不是渲染的高度。任何通过jquery.height()的尝试只会返回不正确的CSS高度(200px)。
任何想法如何确保一个元素在布局调整大小后保持底部,或者访问渲染高度的方式,以便可以通过编程方式将其粘贴回底部?
这里是CSS
.guideScene
{
height : 200px;
width : 200px;
min-width : 190px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: absolute;
}
@media all and (max-width: 768px) {
.guideScene {
height : 100px;
}
}
.guideScene span
{
font-family: 'Lato', sans-serif;
font-color : #000;
font-weight: 700;
font-size: 14px;
line-height: 100%;
min-height: 14px;
background: #fff;
padding: 4px 10px 4px 10px;
bottom: 0px;
width: 100%;
position: absolute;
}
在这里你去popNoodles:
console.log($(this.parentNode).outerHeight(true));
console.log($(this.parentNode).height());
或console.log($(this.parentNode).attr('style')
- 返回后台
console.log(this.parentElement) gives me the data
正是这种属性在这里我想访问!
请同时发布足够的HTML内容,以便轻松地复制。 – Popnoodles 2014-09-11 00:27:47
此外,你已经标记了这是一个JavaScript jQuery的问题,提到了你尝试过的一些jQuery,但没有显示任何JavaScript或jQuery。 – Popnoodles 2014-09-11 00:28:38