I have a dilemma with my website where I am using JavaScript to modify CSS on hover for specific items. Interestingly, in Firefox everything runs smoothly without any ActiveX message popping up. However, in IE8, I encounter a warning stating "To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer. Click here for options..." This seems to be triggered by the following JavaScript code:
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
Despite the warning, the hover effects still function properly in IE8 without me having to allow ActiveX.
My queries are: 1) Is there a way to alter the current JavaScript for the hover effects in order to prevent the ActiveX warning from appearing? 2) Is there a snippet of code that can disable the ActiveX warning altogether, especially since the website functions fine in IE even with the warning?
Thank you