2010-12-13 53 views
0

我創建了一個垂直菜單,它在水平移動時水平展開。它在Chrome和Firefox中像一個夢一樣工作,但是由於某種原因,Internet Explorer並不喜歡它。當懸停在任何元素上時,它們都會彈出。jquery hoverintent,在Chrome和Firefox中工作,當我將鼠標懸停在Internet Explorer中的一個元素上時懸停所有懸停功能都被觸發

該函數使用jquery插件懸停意圖,使用動畫更改css。 下面是一些代碼...

// one of these functions for each menu item, the inactive3 is obviously changed to the different list element 

    $('li.inactive3').hoverIntent(expandit3, resetit3); 

    function expandit3(){ 
$('li.inactive3').stop().animate({ width: "609px",height: "306px"}, "fast"); 
    } 

    function resetit3(){ 
$('li.inactive3').stop().animate({ width: "150px",height: "153px"}, "slow"); 
    } 


// the list elements are contained in the menudiv 

#menudiv { 
z-index: 3; 
float: left; 
visibility: visible; 
position: fixed; 
display:block; 

overflow:hidden; 
} 

// here is the list item css 

    .inactive3 { 
z-index: 3; 
list-style-type: none; 
width: 150px; 
height: 153px; 
overflow: hidden; 
margin: 0px; 
padding: 0px; 
visibility: visible; 
clip:auto; 
display:block; 
} 

任何想法,將extemely有益,因爲我一直在折磨這個問題幾天我的大腦,它只是似乎是某種與IEXPLORER問題。

歡呼

+0

爲您設置格式的代碼。使用「代碼」按鈕或縮進4個空格來獲得不錯的列表。 – Chowlett 2010-12-13 11:09:01

回答

0

,應在所有瀏覽器,讓每個元素的行爲的行爲,你應該使用this當前元素,像這樣:

$('li.inactive3').hoverIntent(expandit3, resetit3); 
function expandit3(){ 
    $(this).stop().animate({ width: "609px",height: "306px"}, "fast"); 
} 
function resetit3(){ 
    $(this).stop().animate({ width: "150px",height: "153px"}, "slow"); 
} 
0

現在我解決了它,只需將列表元素的位置設置爲相對位置,感謝您的幫助。

相關問題