Currently, I am facing an issue with my login screen involving the mouseenter
and mouseleave
events. I have a gif image that disappears when the mouse hovers over it and reappears when the cursor moves to a different part of the page to allow users to enter their ID and password. However, there is a problem when I start typing my password and then move the mouse away, causing the caret focus to be lost.
Below are the relevant code snippets:
<div ID="contDefine" class="wipeForward" onmouseenter="fnToggleDefine1()" onmouseleave="fnToggleDefine2()">
<div ID="oDivDefine1" STYLE="position:absolute; width:454px; height:262px; background:#eff0f0 url('image/outlogin.gif') top repeat-x; "> </div>
<div ID="oDivDefine2" STYLE="visibility:hidden; position:absolute; width:454px; height:262px; background: #eff0f0 url('image/inlogin.gif') top repeat-x; ">
function fnToggleDefine1() {
if(agent.is_ie && !agent.is_ie10){
contDefine.className='wipeForward';
contDefine.filters[0].Apply();
contDefine.filters[0].Play(duration=1);
}
oDivDefine2.style.visibility="visible";
oDivDefine1.style.visibility="hidden";
}
function fnToggleDefine2() {
if(agent.is_ie && !agent.is_ie10){
contDefine.className='wipeReverse';
contDefine.filters[0].Apply();
contDefine.filters[0].Play(duration=1);
}
oDivDefine2.style.visibility="hidden";
oDivDefine1.style.visibility="visible";
}
https://i.sstatic.net/0DntH.jpg
https://i.sstatic.net/OMJBK.jpg
Apologies for any language barrier. Thank you for your help.
Update: As my website only works in Internet Explorer, I attempted to modify my JS function.
function fnToggleDefine2() {
if(agent.is_ie && !agent.is_ie10){
contDefine.className='wipeReverse';
contDefine.filters[0].Apply();
contDefine.filters[0].Play(duration=1);
}
oDivDefine2.style.opaciy="0";
oDivDefine2.style.zIndex="-999";
oDivDefine1.style.visibility="visible";
}
Although I achieved the desired effect, it appears that opacity and zIndex are not functioning correctly in IE. Additionally, the caret focus keeps appearing even when the textbox is blocked by the image.
Please see the following image for reference:
https://i.sstatic.net/3yg1c.jpg
Note: For those who are having trouble understanding my question, please refer to the comment by Shuvro below.