本文介紹了jQuery 中有沒有辦法將 div 放在前面?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
如果我有一堆絕對定位的 div 并且它們重疊,我如何讓某個 div 出現(xiàn)在前面?再次感謝大家!
If I had a bunch of absolute positioned divs and they overlapped, how would I get a certain div to come to the front? Thanks again guys!
推薦答案
這是 CSS 的東西,不是 jQuery 的東西(雖然你可以使用 jQuery 來修改 css).
This is a CSS thing, not a jQuery thing (though you can use jQuery to modify the css).
$('element').css('z-index', 9999); // note: it appears 'zIndex' no longer works
或者,絕對定位會將某些東西帶到頂部:
Or, absolute positioning will bring something to the top:
$('element').css('position', 'absolute');
這篇關(guān)于jQuery 中有沒有辦法將 div 放在前面?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!