|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/klengineers/klwebsite-controller/js/ |
Upload File : |
// JavaScript Document
function scriptInit() {
if (!document.getElementById) {
return;
}
}
function addEvent(elm, evType, fn, useCapture) {
if (elm.addEventListener) {
elm.addEventListener(evType, fn, useCapture);
return true;
} else if (elm.attachEvent) {
var r = elm.attachEvent('on' + evType, fn);
return r;
} else {
elm['on' + evType] = fn;
}
}
function checkActive() {
var a = document.getElementsByTagName("a");
var li = document.getElementsByClassName('inActive');
if (window.location.href.substr(location.href.length - 1, 1) == '/') {
var loc = window.location.href + 'index.html';
}
else {
var loc = window.location.href;
}
for(var i=0; i < a.length; i++) {
if (a[i].href == loc) {
li[i].className='active';
}
}
}
addEvent(window, 'load', checkActive, false);
//window.onload=checkActive;