我有下面的代碼,
<div id="show" display="none"></div>
var ele=document.getElementById('show');
ele.style.display='block';
ele.style.padding='1px';
ele.style.borderLeft='solid 1px #d0d0d0';
ele.style.borderBottom='solid 1px #a0a0a0';
ele.style.position='absolute';
ele.style.borderTop='solid 1px #d0d0d0';
ele.style.borderRight='solid 1px #a0a0a0';
ele.style.backgroundColor='#ffffaa';
ele.style.fontSize='12px';
ele.style.fontFamily='helvetica';
ele.style.color='black';
$(window).mouseover(function(event) {
$("#show").css({'top': (event.pageY)/2, 'left': '10px'});
});
在Internet Explorer中的div沒有得到顯示可能有人請告訴我的代碼更改,使其工作在IE上。
感謝...................
爲什麼你用JavaScript設置初始樣式而不僅僅是普通的css? – Natrium 2010-02-08 09:57:16
需要更多的上下文。 'display =「none」'不是有效的HTML。你爲什麼用JavaScript設置所有這些樣式?那個jQuery代碼應該做什麼計算?你爲什麼期待一個沒有內容的div可見? – 2010-02-08 09:59:44
這段代碼在某些函數中被調用,因此完成了。 – Hulk 2010-02-08 10:00:53