PDA

View Full Version : javascipt code needed


themaraudersmap
06-04-2005, 11:08 PM
Im pretty sure this is the right place to post, but If not please move it, I am just looking for help, not trying to cause problems :)

( oh yea bear with me :) )
Okay, Im trying to have a page set up like this


1Link 2 Link 3Link
____________

1A B 2 A B 3A B


What I want is where I hover over link1 is to have 1ab display(like a drop down) and the same with the rest, but I want it to where when you mouseout, the last one stays up and doesnt dissappear, heres an example of what I found on the internet and imbedded the code into my friends site. The problem is viewing in IE is fien and basically all other browsers read it wrong, thats why Im looking for someone who has the code I want, besides I dont want them under each other if possible but next to each other like the above example.


Here is what I have, but It doesnt work right besides in IE http://www.themaraudersmap.com/daniel/original/ca.html

_Aerospace_Eng_
06-04-2005, 11:16 PM
like this one (http://www.dynamicdrive.com/dynamicindex1/tabmouseover.htm)? This should be in the client side forum. It will be moved for you.

Pegasus
06-04-2005, 11:17 PM
Actually, MM, IE displays what it *thinks* you want to have done. All other browsers display what you've coded. If that's the code he's using, it probably would work better if it were placed inside the <head> tags and not below the </body> tag.

Have you tried looking in www.hotscripts.com or www.a1javascripts.com ?

Peg

themaraudersmap
06-05-2005, 04:05 PM
Okay, I got the code all working, I was wondering if It was possible to where when the page loads, theres already the area that says "move mouse over links to view menu and then when I mouseover the links the menus come up, heres the code if anyone could do this


<!--Links used to initiate the sub menus. Pass in the desired submenu index numbers (ie: 0, 1) -->
<a class=one href="http://www.blah.com" onMouseover="showit(0)">Movies</a> | <a class=one href="http://blah.com" onMouseover="showit(1)">Other Projects</a> | <a class=one href="http://www.blah.com" onMouseover="showit(2)">About</a> <br>

<!-- Edit the dimensions of the below, plus background color-->
<ilayer width=400 height=15 name="dep1" bgColor="#000000">
<layer name="dep2" width=400 height=15>
</layer>
</ilayer>
<div id="describe" style="background-color:#000000;width:400px;height:32px" onMouseover="clear_delayhide()" onMouseout="resetit(event)"></div>


<script language="JavaScript1.2">

/*
Tabs Menu (mouseover)- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/

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[0]='<font size="2" face="courier"><b><a class=two href="http://www.blah.com">Films</a> | <a class=two href="http://www.blah">Effects Tests</a> | <a class=two href="http://www.blah">Compititions</a></b></font>'

submenu[1]='<font size="2" face="courier"><b><a class=two href="http://blah.com">Camera Rigs</a> | <a class=two href="http://blah.com">Graphics</a> | <a class=two href="http://blah.com">Miscellaneous</a> </b></font>'

submenu[2]='<font size="2" face="courier"><b><a class=two href="http://blah.com">About CI</a> | <a class=two href="http://blah.com">Cast & Crew</a> | <a class=two href="http://blah.com">Links</a> | <a class=two href="http://www.blah.com">Contact</a></b></font>'
//Dont touch...time (in milliseconds)
var delay_hide=300000

/////DONT TOUCH
var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""

function showit(which){
clear_delayhide()
thecontent=(which==-1)? "" : 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>

themaraudersmap
06-09-2005, 01:34 AM
*bump* sorry, i really need this done, dont mean to be a pain though

_Aerospace_Eng_
06-09-2005, 01:50 AM
Its been only 4 days, be patient, its not polite to bump. It gets annoying sometimes. The likely reason people aren't helping is because you only gave us a snippet of the code. Give us the FULL code or even better a link. You can TRY to change things yourself.