我已經創建了一個樣本
http://jsbin.com/eqiti3 這裏我們有三個div。現在,我想要做的是:單擊任何div時,它應該出現在其他div的頂部,然後淡出然後回到其原始位置。這是我在用的:爲什麼我無法使用jquery設置div的z-index?
$(".box").click(function() {
var zindex = $(this).css('z-index');
/* this too is not working
$(this).css('z-index',14);
$(this).fadeTo ('slow', 0.5).fadeTo('slow', 1)
$(this).css('z-index',zindex);
*/
$(this).css('z-index',14).fadeTo ('slow', 0.5).fadeTo('slow', 1).css('z-index',zindex);
});
提供$(this).css('z-index',14)
僅憑這能夠使股利其他的div過來的。
真棒!這顯示我對jQuery很新穎:) – 2010-10-13 12:11:54