Hi, I am a novice with javascript and was looking for some help. I found this script
http://www.hotscripts.com/Detailed/45116.html and it won't seem to run in Firefox. It works on IE fine but when I check the console on Firefox it states: "$arr has no properties"
Here is the code:
Quote:
function ClassOver() {
if (!document.getElementById) return
var vOriginSrc;
var $arr = document.all;
for (var i = 0; i < $arr.length; i++) {
if ($arr[i].getAttribute('hcls')) {
$arr[i].onmouseover = function() {
vOriginSrc = this.className;
this.className=this.getAttribute('hcls');
}
$arr[i].onmouseout = function() {
this.className=vOriginSrc;
}
}
if ($arr[i].getAttribute('dcls')) {
$arr[i].onmousedown = function() {
this.className=this.getAttribute('dcls');
}
$arr[i].onmouseup = function() {
this.className=this.getAttribute('hcls');
}
}
}
}
onload=ClassOver;
|
Can anyone help me out with this?