|
-
Aug 7th, 2003, 03:33 AM
#1
Thread Starter
Hyperactive Member
menu click
Hi,
I'm developing a website with 3 frames:
TopMenu
LeftMenu
Main
On the TopMenu I have a number of gifs to display the links (typical: TopNav_link1.gif)
and for the LeftMenu I have a few other gifs(typical: LeftNav_link1.gif)
When I click on either image I want it to change, so TopNav_link1.gif becomes TopNav_Bold_link1.gif
the same for the items in LeftMenu.
This works by calling the function MM_nbGroup(event, grpName)
Next I want to change the TopMenu image also when I click on the LeftMenu.
Can I do that with the same function, or is something special desired here?
What does grpName in the function mean: is it the frame, or is it something else?
Kind regards
-
Aug 7th, 2003, 03:18 PM
#2
Fanatic Member
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Aug 8th, 2003, 02:22 AM
#3
Thread Starter
Hyperactive Member
Here is the function:
------------------
function MM_nbGroup(event, grpName) { //v3.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
if ((nbArr = document[grpName]) != null)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
}
------------------
So when I call it:
onClick="MM_nbGroup('down','group1','myPicID','myPicFile',1)"
This function is just floating around the internet.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|