我有一個問題,我使用的是一個調整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