Basically I have two 'sets' of rollover images on a a page. The first example is on everypage, but the second changes depending on what page you are on.
When I had just the one set the rollover worked fine, but now I introduced the second set, the rollovers are just referring to the second example below.
I guess its a problem with addressing the array and the second array is overwriting the first?
Any Ideas?
When I had just the one set the rollover worked fine, but now I introduced the second set, the rollovers are just referring to the second example below.
I guess its a problem with addressing the array and the second array is overwriting the first?
Any Ideas?
Code:
var menus = new Array('home','env','admim', 'research', 'business', 'services', 'people', 'intranet', 'vacancies', 'contactus');
var i;
var imgs = new Array(menus.length);
for (i = 0; i < menus.length; i++) {
imgs[i] = new Image();
imgs[i].src = 'buttons/topmenu_' + menus[i] + '_mo.gif';
}
function mm(obj, i) {
obj.ori = obj.src;
obj.src = imgs[i].src;
}
function mm2(obj) {
obj.src = obj.ori;
}
Code:
var menuspeople = new Array('a2z', 'faculty', 'resstaff', 'postgrad', 'adminstaff', 'technicians');
var i;
var imgs = new Array(menuspeople.length);
for (i = 0; i < menuspeople.length; i++) {
imgs[i] = new Image();
imgs[i].src = '/env/_henry/buttons/people_' + menuspeople[i] + '_mo.gif';
}
function mmpeople(obj, i) {
obj.ori = obj.src;
obj.src = imgs[i].src;
}
function mmpeople2(obj) {
obj.src = obj.ori;
}