2011-02-11 18 views

回答

1

如果我理解正確,並且想要將鼠標懸停在鼠標上方,可以這樣做。

將4個div與角落圖像作爲背景。

CSS:

d1, d2, d3, d4 

{ 

    position:absolute; 
    display:none; 

} 

d1 
{ 

    background-image:url('cornertop.extension'); 
    top:0px; 
    left:0px; 

} 

等所有

HTML:

<div id="yourid" onmouseover="roundCorners();" onmouseout="deRoundCorners()"> 
content 
</div> 

的javascript:

function roundCorners() 
{ 

    document.getElementById('d1').style.display=block; 
    document.getElementById('d2').style.display=block; 
    document.getElementById('d3').style.display=block; 
    document.getElementById('d4').style.display=block; 

} 

function deRoundCorners() 
{ 

    document.getElementById('d1').style.display="none"; 
    document.getElementById('d2').style.display="none"; 
    document.getElementById('d3').style.display="none"; 
    document.getElementById('d4').style.display="none"; 

} 

如果我理解正確的是應該這樣做?如果沒有...給更多的細節請。

+0

感謝您的幫助..主要內容背景也是圖片.. – binoy 2011-02-11 10:11:39

相關問題