Help With IPB Mod I'm Developing

Status
Not open for further replies.

AdView

New Member
Messages
61
Reaction score
0
Points
0
I'm working on a rollover member legend and which I have already released here and on invision modding. The mod had little icons to represent each member group and there is test below the icons to show you what the name of the member that the icon represents is. When you first go to you website you will see "Hover over the icons to view group information" in the text area below the team icons, but the problem is after you move off the team icons I want it to go back to the message and I get it to do so. I'm thinking that it has to do with Javascript and Javascipt functions, so I need someone to look over the code and tell me whe problem is and how to fix it so it will do what I want it to do:

Download the code at:
http://www.megaupload.com/?d=MVRBF9EA
 

woiwky

New Member
Messages
390
Reaction score
0
Points
0
For code that small, you could have just pasted it here rather than uploading it, in rtf format no less, to a site which makes you wait 45 seconds to download files.

But anyway, I'm a little confused here so my suggestion might not be what you want. However, try adding the line:

Code:
submenu[-1]='<font color="#313131">--</font><font color="#708090"><i>Hover over the icons to view group information.</i></font>';

where the other submenu definitions are. Then change this:

Code:
thecontent=(which==-1)? "" : submenu[which]

to this:

Code:
thecontent=submenu[which]

I *think* that should make the effect you want.
 

AdView

New Member
Messages
61
Reaction score
0
Points
0
For code that small, you could have just pasted it here rather than uploading it, in rtf format no less, to a site which makes you wait 45 seconds to download files.

But anyway, I'm a little confused here so my suggestion might not be what you want. However, try adding the line:

Code:
submenu[-1]='<font color="#313131">--</font><font color="#708090"><i>Hover over the icons to view group information.</i></font>';

where the other submenu definitions are. Then change this:

Code:
thecontent=(which==-1)? "" : submenu[which]

to this:

Code:
thecontent=submenu[which]

I *think* that should make the effect you want.

What do you mean bythe second part?
 

woiwky

New Member
Messages
390
Reaction score
0
Points
0
I'll just post the whole modified code to make it easier.

Code:
<!--Code by cgrim29588 of [URL]http://z9.invisionfree.com/Simple_Systems/index.php[/URL]? //-->
<br /><br /><font color="#313131">--</font><b>Forum Legend</b><br />
<div align='left'><font color="#313131">-</font>
<img src="http://www.nslamafia.net/Pictures/Legend/MonarchialLegend.png" onMouseover="showit(0)"> 
<img src="http://www.nslamafia.net/Pictures/Legend/ExecutiveLegend.png" onMouseover="showit(1)"> 
<img src="http://www.nslamafia.net/Pictures/Legend/LegislativeLegend.png" onMouseover="showit(2)">
<img src="http://www.nslamafia.net/Pictures/Legend/JudicialLegend.png" onMouseover="showit(3)">
<img src="http://www.nslamafia.net/Pictures/Legend/SoldierLegend.png" onMouseover="showit(4)">
<img src="http://www.nslamafia.net/Pictures/Legend/CitizenLegend.png" onMouseover="showit(5)">
<img src="http://www.nslamafia.net/Pictures/Legend/HGLegend.png" onMouseover="showit(6)">
<img src="http://www.nslamafia.net/Pictures/Legend/AmbassadorLegend.png" onMouseover="showit(7)"><br />



<div id="describe" onMouseover="clear_delayhide()" onMouseout="restit(event)"><font color="#313131">--</font><font color="#708090"><i>Hover over the icons to view group information.</i></font>
</div></div><br />

                       </td>
        </tr>
        <!--IBF.WHOSCHATTING-->

<script language="JavaScript1.2">
var submenu=new Array()

//Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors.

submenu[-1]='<font color="#313131">--</font><font color="#708090"><i>Hover over the icons to view group information.</i></font>';
submenu[0]='<font color="#313131">--</font><font color="#168000"><b>Monarchical Officials</b></font>'
submenu[1]='<font color="#313131">--</font><font color="#8B0000"><b>Executive Officials</b></font>'
submenu[2]='<font color="#313131">--</font><font color="#07008D"><b>Legislative Officials</b></font>'
submenu[3]='<font color="#313131">--</font><font color="#E47D00"><b>Judicial Officials</b></font>'
submenu[4]='<font color="#313131">--</font><font color="#E21B00"><b>Soldiers</b></font>'
submenu[5]='<font color="#313131">--</font><font color="#FFFFFF"><b>Citizens</b></font>'
submenu[6]='<font color="#313131">--</font><font color="#D7C200"><b>Honoured Guests</b></font>'
submenu[7]='<font color="#313131">--</font><font color="#C0C0C0"><b>Ambassadors</b></font>'

//Set delay before submenu disappears after mouse moves out of it (in milliseconds)
var delay_hide=500

/////No need to edit beyond here

var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""
function showit(which){
clear_delayhide()
thecontent=submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}
function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}
function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}
function contains_ns6(a, B){
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
</script>
 

AdView

New Member
Messages
61
Reaction score
0
Points
0
Still not giving me the effect i'm looking for


MemberLegendWhatIWantittoDo.jpg
 
Last edited:

woiwky

New Member
Messages
390
Reaction score
0
Points
0
Could you make that board online so that I can view the full source and test it myself?

***

Nevermind, I think I spotted the problem. Try this:

Code:
<!--Code by cgrim29588 of [url="http://z9.invisionfree.com/Simple_Systems/index.php"]http://z9.invisionfree.com/Simple_Systems/index.php[/url]? //-->
<br /><br /><font color="#313131">--</font><b>Forum Legend</b><br />
<div align='left'><font color="#313131">-</font>
<img src="http://www.nslamafia.net/Pictures/Legend/MonarchialLegend.png" onMouseover="showit(0)"> 
<img src="http://www.nslamafia.net/Pictures/Legend/ExecutiveLegend.png" onMouseover="showit(1)"> 
<img src="http://www.nslamafia.net/Pictures/Legend/LegislativeLegend.png" onMouseover="showit(2)">
<img src="http://www.nslamafia.net/Pictures/Legend/JudicialLegend.png" onMouseover="showit(3)">
<img src="http://www.nslamafia.net/Pictures/Legend/SoldierLegend.png" onMouseover="showit(4)">
<img src="http://www.nslamafia.net/Pictures/Legend/CitizenLegend.png" onMouseover="showit(5)">
<img src="http://www.nslamafia.net/Pictures/Legend/HGLegend.png" onMouseover="showit(6)">
<img src="http://www.nslamafia.net/Pictures/Legend/AmbassadorLegend.png" onMouseover="showit(7)"><br />



<div id="describe" onMouseover="clear_delayhide()" onMouseout="resetit(event)"><font color="#313131">--</font><font color="#708090"><i>Hover over the icons to view group information.</i></font>
</div></div><br />

                       </td>
        </tr>
        <!--IBF.WHOSCHATTING-->

<script language="JavaScript1.2">
var submenu=new Array()

//Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors.

submenu[-1]='<font color="#313131">--</font><font color="#708090"><i>Hover over the icons to view group information.</i></font>';
submenu[0]='<font color="#313131">--</font><font color="#168000"><b>Monarchical Officials</b></font>'
submenu[1]='<font color="#313131">--</font><font color="#8B0000"><b>Executive Officials</b></font>'
submenu[2]='<font color="#313131">--</font><font color="#07008D"><b>Legislative Officials</b></font>'
submenu[3]='<font color="#313131">--</font><font color="#E47D00"><b>Judicial Officials</b></font>'
submenu[4]='<font color="#313131">--</font><font color="#E21B00"><b>Soldiers</b></font>'
submenu[5]='<font color="#313131">--</font><font color="#FFFFFF"><b>Citizens</b></font>'
submenu[6]='<font color="#313131">--</font><font color="#D7C200"><b>Honoured Guests</b></font>'
submenu[7]='<font color="#313131">--</font><font color="#C0C0C0"><b>Ambassadors</b></font>'

//Set delay before submenu disappears after mouse moves out of it (in milliseconds)
var delay_hide=500

/////No need to edit beyond here

var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""
function showit(which){
clear_delayhide()
thecontent=submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}
function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}
function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}
function contains_ns6(a, b){
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
</script>

There were some naming discrepancies.
 
Last edited:

AdView

New Member
Messages
61
Reaction score
0
Points
0
Still not working as intended. I have put the board online, but for only to minutes. Here is the link to my board: [Link Removed]
Edit:
Bump
Edit:
I got it to work thank everyone fr your help
 
Last edited by a moderator:
Status
Not open for further replies.
Top