paul_s
06-29-2000, 03:12 PM
Hey ppl's, luv these Fourms.....
Was wondering if ne1 could help me out ?
Am trying to set up some navagation buttons with a set of three images, the mouseoff & mouseon pics & another pic that will appear when the button has been clicked & the coresponding page is loaded ?
Help please !!
Paul
Kool Dude
06-29-2000, 05:18 PM
Try this, I think it is what you're after. :)
http://www.pageresource.com/jscript/jbut2.htm
Vincent Puglia
06-29-2000, 05:25 PM
Hi paul,
Do you have anything started that you can show us?
If not, the following link will show you how to create image flips:
http://www.webxpertz.net/scripts/local/simage1.htm
You can build upon that by adding an onClick event handler to your href tags. something like:
<a href....onClick="javascript:doIt()">
The doIt() function could execute displaying the other pic, and do whatever else you need.
Vinny
paul_s
06-30-2000, 03:44 AM
Sure, thanks 4 the reply....
have code as below, sort of works but am gettin a couple of errors ???
<!-- Hide Javascripting
var activePage = ""
function newArray(n)
{
this.length=n;
for (var i=1; i<=n; i++)
{
this[i]=0;
}
return this
}
buttonImg1=new newArray(24);
buttonImg1[1] = new Image(106,20);
buttonImg1[1].src = "images/homebut1.gif";
buttonImg1[2] = new Image(106,20);
buttonImg1[2].src = "images/newsbut1.gif";
buttonImg1[3] = new Image(106,20);
buttonImg1[3].src = "images/calbut1.gif";
buttonImg1[4] = new Image(106,20);
buttonImg1[4].src = "images/actbut1.gif";
buttonImg1[5] = new Image(106,20);
buttonImg1[5].src = "images/badgebut1.gif";
buttonImg1[6] = new Image(106,20);
buttonImg1[6].src = "images/leadbut1.gif";
buttonImg1[7] = new Image(106,20);
buttonImg1[7].src = "images/mailbut1.gif";
buttonImg1[8] = new Image(106,20);
buttonImg1[8].src = "images/gbookbut1.gif";
buttonImg1[9] = new Image(106,20);
buttonImg1[9].src = "images/homebut2.gif";
buttonImg1[10] = new Image(106,20);
buttonImg1[10].src = "images/newsbut2.gif";
buttonImg1[11] = new Image(106,20);
buttonImg1[11].src = "images/calbut2.gif";
buttonImg1[12] = new Image(106,20);
buttonImg1[12].src = "images/actbut2.gif";
buttonImg1[13] = new Image(106,20);
buttonImg1[13].src = "images/badgebut2.gif";
buttonImg1[14] = new Image(106,20);
buttonImg1[14].src = "images/leadbut2.gif";
buttonImg1[15] = new Image(106,20);
buttonImg1[15].src = "images/mailbut2.gif";
buttonImg1[16] = new Image(106,20);
buttonImg1[16].src = "images/gbookbut2.gif";
buttonImg1[17] = new Image(106,20);
buttonImg1[17].src = "images/homebut3.gif";
buttonImg1[18] = new Image(106,20);
buttonImg1[18].src = "images/newsbut3.gif";
buttonImg1[19] = new Image(106,20);
buttonImg1[19].src = "images/calbut3.gif";
buttonImg1[20] = new Image(106,20);
buttonImg1[20].src = "images/actbut3.gif";
buttonImg1[21] = new Image(106,20);
buttonImg1[21].src = "images/badgebut3.gif";
buttonImg1[22] = new Image(106,20);
buttonImg1[22].src = "images/leadbut3.gif";
buttonImg1[23] = new Image(106,20);
buttonImg1[23].src = "images/mailbut3.gif";
buttonImg1[24] = new Image(106,20);
buttonImg1[24].src = "images/gbookbut3.gif";
function cleanUp()
{
for (var x=1 ; x<9 ; x++)
{
document.images[x].src = buttonImg1[x].src;
}
}
function clickImg(buttonInx,otherImg)
{
cleanUp()
document.images[buttonInx].src = buttonImg1[otherImg].src;
activePage = buttonInx
return true;
}
function flipImg(buttonInx,otherImg)
{
if (buttonInx != activePage)
{
window.document.images[buttonInx].src = buttonImg1[otherImg].src;
return true;
}
}
// End hiding of JavaScript -->
</SCRIPT>
</HEAD>
<BODY>
<a href="main.html" onMouseOver="flipImg(1,17); window.status='Back to the Start Page' ; return true" onMouseOut="flipImg(1,1); window.status=''; return true" onClick="clickImg(1,9)" target="mainframe">
<IMG SRC="images/homebut1.gif" WIDTH=106 HEIGHT=20 BORDER=0></a>
<BR>
<a href="news.html" onMouseOver="flipImg(2,18); window.status='All the Latest News & Info'; return true" onMouseOut="flipImg(2,2); window.status=''; return true" onClick="clickImg(2,10)" target="mainframe">
<IMG SRC="images/newsbut1.gif" WIDTH=106 HEIGHT=20 BORDER=0></a>
<BR>
<a href="calender.html" onMouseOver="flipImg(3,19); window.status='Calender of Upcoming Events & Activities'; return true" onMouseOut="flipImg(3,3); window.status=''; return true" onClick="clickImg(3,11)" target="mainframe">
<IMG SRC="images/calbut1.gif" WIDTH=106 HEIGHT=20 BORDER=0></a>
<BR>
<a href="activities.html" onMouseOver="flipImg(4,20); window.status='Past Events & Activities'; return true" onMouseOut="flipImg(4,4); window.status=''; return true" onClick="clickImg(4,12)" target="mainframe">
<IMG SRC="images/actbut1.gif" WIDTH=106 HEIGHT=20 BORDER=0></a>
<BR>
<a href="badges.html" onMouseOver="flipImg(5,21); window.status='All the Badge Info'; return true" onMouseOut="flipImg(5,5); window.status=''; return true" onClick="clickImg(5,13)" target="mainframe">
<IMG SRC="images/badgebut1.gif" WIDTH=106 HEIGHT=20 BORDER=0></a>
<BR>
<a href="leaders.html" onMouseOver="flipImg(6,22); window.status='Leaders Info & Resorces'; return true" onMouseOut="flipImg(6,6); window.status=''; return true" onClick="clickImg(6,14)" target="mainframe">
<IMG SRC="images/leadbut1.gif" WIDTH=106 HEIGHT=20 BORDER=0></a>
<BR>
<a href="mailing.html" onMouseOver="flipImg(7,23); window.status='Join the Mailing List - NOW !'; return true" onMouseOut="flipImg(7,7); window.status=''; return true" onClick="clickImg(7,15)" target="mainframe">
<IMG SRC="images/mailbut1.gif" WIDTH=106 HEIGHT=20 BORDER=0></a>
<BR>
<a href="guestbook.html" onMouseOver="flipImg(8,24); window.status='Sign the GuestBook' ; return true" onMouseOut="flipImg(8,8); window.status=''; return true" target="mainframe">
<IMG SRC="images/gbookbut1.gif" WIDTH=106 HEIGHT=20 BORDER=0></a>
ne ideas ????
amberbot
06-30-2000, 04:07 AM
Hi Paul,
I recently found a neat mouseover generator for multiple images, I still haven't used it but if you want to try it out it generates the code for you. Good luck!
(Javascript buttons III)
http://www.lonewolf.gr/software/default.asp
paul_s
06-30-2000, 12:17 PM
Thanks, but not quite what I was chasing, from looking @ this & other help forums this seems 2 be a pretty common request, perhaps a tut somewhere on this type of function would be a good idea ?? ....
ne help on the above code would still be greatly appriciated !
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.