2016-05-15 37 views
0

圖片:哈弗沒有元素檢測

problem depicting picture

我想要什麼:

我想懸停進行註冊,甚至當鼠標光標是藍色菱形移過上圖中的區域。

問題:

每當懸停在藍色菱形區域,其以可視方式顯示在.path_part用戶作爲一個區域,懸停規則.folder_path .path_part:hover未施加上.part_part

我試了一下:

設置的.path_partz-index 10000和的.right_arrow爲-1。仍然沒有運氣。

JSFiddle link

+0

你需要'position:relative'在你想要應用'z-index'的元素上。另外更改Z-index爲1而不是-1 https://jsfiddle.net/m1pacc6z/3/ – Miro

回答

1

工作fiddle.

首先,z-index可得注意的是,只有左部.right-arrow.path-part重疊的9999

一件事的最大值,並自懸停處理程序僅在.path-part上,只有左側部分纔會觸發懸停處理程序。

另外,對於z-index工作既.path-part.right-arrow需要被定位,即,位置屬性設置爲relativeabsolutefixed

你的CSS更改爲:

.folder_path .right_arrow { 
    position: relative; 
    z-index: 1; 
    display: inline-block; 
    vertical-align: middle; 
    height: 35px; 
    width: 35px; 
    content: ""; 
    -webkit-transform: rotate(-45deg); 
    transform: rotate(-45deg); 
    border: 1px solid rgba(0, 0, 0, 0.2); 
    -webkit-mask-image: -webkit-gradient(linear, left top, right  bottom, from(transparent), color-stop(0.5, transparent), color-stop(0.5, #000000), to(#000000)); 
    margin-left: -25px;  
} 

.folder_path .path_part { 
    position: relative; 
    display: inline-block; 
    height: 50px; 
    line-height: 50px; 
    vertical-align: middle; 
    min-width: 40px; 
    font-size: 20px; 
    padding: 0 10px; 
    z-index: 2; 
} 
+0

我認爲小提琴鏈接有問題。它不適用於我的鉻合金,我將鼠標懸停在箭頭上,並且該項目未亮起之前 – Keatinge

+0

這是因爲只有箭頭的左側部分與具有懸停處理程序的路徑部分重疊。 –

0
$(".path_part").hover(function(){ 
     $(this).next().css({"background": "rgba(255, 255, 255, 0.3)"}); 
    }, function(){ 
     $(this).next().css({"background": "unset"}); 
    }); 

您可以使用jquery.This代碼會爲你工作。