Curtis D
06-07-2006, 06:50 AM
Hello everyone! You guys have some great forums! :thumbsup:
I've really come to my wit's end here. I have put my code on my site (http://dyersweb.com/projects/iehelp.html). The JavaScript file is here (http://dyersweb.com/projects/iehelp.js).
My intent was to create a script that would sufficiently mimic the CSS ability to: 1) use the :hover pseudo-class on elements other than links, and 2) implement the :focus pseudo-class functionality. As most are aware, Internet Explorer needs JavaScript to utilize these behaviors which should be available in CSS2.1. I wanted to separate the behavior from the markup as much as possible, so I went with using the traditional event registration model (http://www.quirksmode.org/index.html?/js/dom0.html).
My main problem arises when utilizing both element.onmouseover/onmouseout and element.onfocus/onblur on events. The first link to my example shows the form and submit button. When either element has focus, it should take precedence, however, I was unable to ensure that the onmouseout event would not override the effects of onfocus. So, if the text turns red when the box has focus, I need it to stay red even if the user removes their mouse from the box. I have tried setting the onmouseout event to null within the onfocus function, but to no avail.
I have tried various searches with Google, but have been unable to come up with keywords that specify my situation concisely enough. I apologize if I have overlooked such a common problem within these forums, but it didn't seem to be addressed within the handy JavaScript FAQ, so I guess it's not an every-day type of thing.
I apologize for my long-windedness, and thank you all for your time,
Curtis
I've really come to my wit's end here. I have put my code on my site (http://dyersweb.com/projects/iehelp.html). The JavaScript file is here (http://dyersweb.com/projects/iehelp.js).
My intent was to create a script that would sufficiently mimic the CSS ability to: 1) use the :hover pseudo-class on elements other than links, and 2) implement the :focus pseudo-class functionality. As most are aware, Internet Explorer needs JavaScript to utilize these behaviors which should be available in CSS2.1. I wanted to separate the behavior from the markup as much as possible, so I went with using the traditional event registration model (http://www.quirksmode.org/index.html?/js/dom0.html).
My main problem arises when utilizing both element.onmouseover/onmouseout and element.onfocus/onblur on events. The first link to my example shows the form and submit button. When either element has focus, it should take precedence, however, I was unable to ensure that the onmouseout event would not override the effects of onfocus. So, if the text turns red when the box has focus, I need it to stay red even if the user removes their mouse from the box. I have tried setting the onmouseout event to null within the onfocus function, but to no avail.
I have tried various searches with Google, but have been unable to come up with keywords that specify my situation concisely enough. I apologize if I have overlooked such a common problem within these forums, but it didn't seem to be addressed within the handy JavaScript FAQ, so I guess it's not an every-day type of thing.
I apologize for my long-windedness, and thank you all for your time,
Curtis