나는이 문제를 조금 파고 들었지만 여기에서하려고하는 정확한 것을 찾을 수 없었습니다. 기본적으로 나는 마우스 오버시 이미지 상단에 숨겨진 레이어를 표시하고 싶은 이미지 맵을 가지고 있습니다. 5 개의 다른 핫스팟과 5 개의 서로 다른 숨겨진 레이어가 해당 핫스팟을 마우스 오버 할 때 표시됩니다.마우스 오버 이미지로 사용되는 투명 PNG에서 깜박임 받기
문제는 이것입니다. 상단의 숨겨진 레이어 각각에는 투명 비트가 포함 된 PNG가 포함되어 있으며 PNG는 사용자의 마우스가있는 곳과 거의 동일하게 나타납니다. 마우스 오버로 호출하면 PNG가 빠르게 깜박입니다 ... 투명성으로 인해 페이지가 마우스의 위 또는 아래에 있는지 여부를 결정하는 데 문제가있는 것으로 추정됩니다 ...?
누구나 똑똑한 해결책이 있습니까?
<script type="text/javascript" language="JavaScript">
<!--
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}
//-->
</script>
를 그리고이 페이지의 본문에 : :
나는 머리에이있어
<div id="homeowners"
style="display:none;
position:absolute;
left:0px;
top:39px;
padding: 5px;
z-index:10;">
<img src="<?php bloginfo('template_directory'); ?>/images/homeowners-over.png" width="257" height="107" alt="Homeowners" /></div>
<div id="dealers"
style="display:none;
position:absolute;
left:319px;
top:39px;
padding: 5px;
z-index:10;">
<img src="<?php bloginfo('template_directory'); ?>/images/dealers-over.png" width="257" height="107" alt="Dealers" /></div>
<div id="commercial"
style="display:none;
position:absolute;
left:0px;
top:509px;
padding: 5px;
z-index:10;">
<img src="<?php bloginfo('template_directory'); ?>/images/commercial-over.png" width="257" height="107" alt="Commercial" /></div>
<div id="importers"
style="display:none;
position:absolute;
left:319px;
top:509px;
padding: 5px;
z-index:10;">
<img src="<?php bloginfo('template_directory'); ?>/images/importers-over.png" width="257" height="107" alt="Importers" /></div>
<img src="<?php bloginfo('template_directory'); ?>/images/aww_home.jpg" width="586" height="638" border="0" usemap="#Map" />
<map name="Map" id="Map">
<area shape="poly" coords="3,4,293,4,293,25,4,313" href="#"
onmouseover="ShowContent('homeowners'); return true;"
href="javascript:ShowContent('homeowners')"
onmouseout="HideContent('homeowners'); return true;"
href="javascript:HideContent('homeowners')">
<area shape="poly" coords="296,5,583,4,584,312,296,27" href="#"
onmouseover="ShowContent('dealers'); return true;"
href="javascript:ShowContent('dealers')"
onmouseout="HideContent('dealers'); return true;"
href="javascript:HideContent('dealers')">
<area shape="poly" coords="294,32,8,317,295,603,575,318" href="#" />
<area shape="poly" coords="5,322,4,633,294,634,294,608" href="#"
onmouseover="ShowContent('commercial'); return true;"
href="javascript:ShowContent('commercial')"
onmouseout="HideContent('commercial'); return true;"
href="javascript:HideContent('commercial')">
<area shape="poly" coords="299,607,299,634,582,634,580,325" href="#"
onmouseover="ShowContent('importers'); return true;"
href="javascript:ShowContent('importers')"
onmouseout="HideContent('importers'); return true;"
href="javascript:HideContent('importers')">
</map>
많은 감사합니다!
이벤트가 설정된 방식과 관련해서는 정확히 그런 것은 아니지만, 기본적인 문제에 직면 해 있다고 생각합니다. 잘못된 이벤트에 mouseout 이벤트를 첨부했습니다. mouseover 및 mouseout 이벤트는 모두 숨겨진 PNG 밑에 이미지의 핫스팟 영역에 적용됩니다. 당신은 내게 정말로 좋은 단서를주었습니다 ... 어떻게 든 mouseout 이벤트를 다르게 설정해야한다고 생각합니다. 나는 가서 무언가를 시도하고 다시보고 할 것입니다. 감사! – Tim